Skip to content

Commit

Permalink
fix #3674
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed May 11, 2024
1 parent b033232 commit 5685777
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/llmtuner/train/tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def export_model(args: Optional[Dict[str, Any]] = None) -> None:
output_dtype = getattr(model.config, "torch_dtype", torch.float16)
setattr(model.config, "torch_dtype", output_dtype)
model = model.to(output_dtype)
else:
setattr(model.config, "torch_dtype", torch.float16)

model.save_pretrained(
save_directory=model_args.export_dir,
Expand Down

0 comments on commit 5685777

Please sign in to comment.