fix compute dtype

This commit is contained in:
hiyouga committed 2023-07-05 15:13:00 +08:00
1 parent c136f362c1
commit 8e3540c62d
1 file changed
+1 -1
+1 -1
View File
@@ -213,7 +213,7 @@ def load_pretrained(
model = AutoModelForCausalLM.from_pretrained(
model_to_load,
config=config,
torch_dtype=model_args.compute_dtype,
torch_dtype=torch.bfloat16 if model_args.compute_dtype == torch.bfloat16 else torch.float16,
low_cpu_mem_usage=True,
**config_kwargs
)