Skip to content

Commit

Permalink
fix bug in run_clm_no_trainer.py (#1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
xin3he authored May 22, 2024
1 parent 0dbce1a commit d640297
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,13 @@ def eval_func(model):

if args.ipex:
user_model = load(os.path.abspath(os.path.expanduser(args.output_dir)))
tokenizer = AutoTokenizer.from_pretrained(args.model, trust_remote_code=args.trust_remote_code)
else:
user_model, _ = get_user_model()
user_model, tokenizer = get_user_model()
kwargs = {'weight_only': True} if args.approach == 'weight_only' else {}
user_model = load(os.path.abspath(os.path.expanduser(args.output_dir)), user_model, **kwargs)
else:
user_model, _ = get_user_model()
user_model, tokenizer = get_user_model()

if args.accuracy:
user_model.eval()
Expand Down

0 comments on commit d640297

Please sign in to comment.