mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-15 16:18:10 +08:00
tiny fix
Former-commit-id: c39cf3439a3025f703d50ac414c10ef3c8486a1f
This commit is contained in:
parent
39f75c7001
commit
04e0fe9147
@ -64,14 +64,13 @@ def export_model(args: Optional[Dict[str, Any]] = None):
|
|||||||
for param in model.parameters():
|
for param in model.parameters():
|
||||||
param.data = param.data.to(output_dtype)
|
param.data = param.data.to(output_dtype)
|
||||||
|
|
||||||
# Configuration check and fix
|
gen_config = model.generation_config # check and fix generation config
|
||||||
config = model.generation_config
|
if not gen_config.do_sample and (
|
||||||
if not config.do_sample and (
|
(gen_config.temperature is not None and gen_config.temperature != 1.0)
|
||||||
(config.temperature is not None and config.temperature != 1.0) or
|
or (gen_config.top_p is not None and gen_config.top_p != 1.0)
|
||||||
(config.top_p is not None and config.top_p != 1.0) or
|
or (gen_config.typical_p is not None and gen_config.typical_p != 1.0)
|
||||||
(config.typical_p is not None and config.typical_p != 1.0)
|
|
||||||
):
|
):
|
||||||
config.do_sample = True
|
gen_config.do_sample = True
|
||||||
|
|
||||||
model.save_pretrained(
|
model.save_pretrained(
|
||||||
save_directory=model_args.export_dir,
|
save_directory=model_args.export_dir,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user