Skip to content

Commit

Permalink
fix falcon-40b conversion error (#153)
Browse files Browse the repository at this point in the history
as titled
  • Loading branch information
xczhai authored Jan 18, 2024
1 parent 01cf349 commit 4aa848a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llm_bench/python/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ def convert_to_ov(pt_model, tok, out_path, compress_to_fp16=False):
model_kwargs = {"torch_dtype": torch.float32}
pt_model = None
compress_to_fp16 = is_fp16(args)
ov_out_path = Path(args.output_dir) / PYTORCH_DIR / OV_DIR / args.precision
if not compression_only:
pt_model = AutoModelForCausalLM.from_pretrained(
args.model_id,
Expand All @@ -1034,8 +1035,7 @@ def convert_to_ov(pt_model, tok, out_path, compress_to_fp16=False):
pt_model.save_pretrained(pt_out_dir)
save_tokenizer(tok, pt_out_dir)

ov_out_path = Path(args.output_dir) / PYTORCH_DIR / OV_DIR / args.precision
convert_to_ov(pt_model, tok, ov_out_path, compress_to_fp16)
convert_to_ov(pt_model, tok, ov_out_path, compress_to_fp16)

if is_torch_compression(args):
assert "INT8" in args.compress_weights or "INT8_ASYM" in args.compress_weights, "Only INT8 compression supported for PyTorch backend"
Expand Down

0 comments on commit 4aa848a

Please sign in to comment.