add npu examples

This commit is contained in:
hiyouga
2024-05-14 23:32:53 +08:00
parent ee4752f6d2
commit af343034dd
9 changed files with 103 additions and 19 deletions

View File

@@ -1,8 +1,3 @@
import os
import torch
from transformers import is_torch_npu_available
from llmtuner.train.tuner import run_exp
@@ -16,7 +11,4 @@ def _mp_fn(index):
if __name__ == "__main__":
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()