From 662b9a9dcfadb01a903d3672e277929ec1875ed4 Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Sun, 21 Jan 2024 12:39:38 +0800 Subject: [PATCH] Update tuner.py --- src/llmtuner/train/tuner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llmtuner/train/tuner.py b/src/llmtuner/train/tuner.py index 2bdb9fe5..c24e5eac 100644 --- a/src/llmtuner/train/tuner.py +++ b/src/llmtuner/train/tuner.py @@ -59,8 +59,8 @@ def export_model(args: Optional[Dict[str, Any]] = None): if hasattr(model.config, "torch_dtype"): model = model.to(getattr(model.config, "torch_dtype")).to("cpu") else: - model = model.to(torch.float32).to("cpu") - setattr(model.config, "torch_dtype", "float32") + model = model.to(torch.float16).to("cpu") + setattr(model.config, "torch_dtype", torch.float16) model.save_pretrained( save_directory=model_args.export_dir,