Apply suggestions from code review

Co-authored-by: Huazhong Ji <hzji210@gmail.com>
This commit is contained in:
hoshi-hiyouga 2024-05-14 20:44:04 +08:00 committed by GitHub
parent 28ae947161
commit 0ac6e73f99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -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()