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