Skip to content

Commit

Permalink
[NPU] Fix generate example (#12541)
Browse files Browse the repository at this point in the history
  • Loading branch information
plusbang authored Dec 13, 2024
1 parent 1521994 commit d20a968
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
attn_implementation="eager"
)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
tokenizer.save_pretrained(args.lowbit_path)
else:
model = AutoModelForCausalLM.load_low_bit(
args.lowbit_path,
Expand All @@ -66,6 +65,7 @@

if args.lowbit_path and not os.path.exists(args.lowbit_path):
model.save_low_bit(args.lowbit_path)
tokenizer.save_pretrained(args.lowbit_path)

with torch.inference_mode():
input_ids = tokenizer.encode(args.prompt, return_tensors="pt")
Expand Down

0 comments on commit d20a968

Please sign in to comment.