mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 15:52:49 +08:00
Apply suggestions from code review
Co-authored-by: Huazhong Ji <hzji210@gmail.com> Former-commit-id: a435e5a0bdd7268c4f1204f99f289ee0b36fd930
This commit is contained in:
parent
3d1b0e1864
commit
fe1a3b1367
@ -1,6 +1,4 @@
|
||||
import os
|
||||
import torch
|
||||
import torch_npu
|
||||
from torch_npu.contrib import transfer_to_npu
|
||||
from llmtuner.train.tuner import run_exp
|
||||
|
||||
@ -15,6 +13,7 @@ def _mp_fn(index):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
use_jit_compile = os.getenv('JIT_COMPILE', 'False').lower() in ['true', '1']
|
||||
torch.npu.set_compile_mode(jit_compile=use_jit_compile)
|
||||
if is_torch_npu_available():
|
||||
use_jit_compile = os.getenv('JIT_COMPILE', 'False').lower() in ['true', '1']
|
||||
torch.npu.set_compile_mode(jit_compile=use_jit_compile)
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user