mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
[config] fix export max len (#7230)
Former-commit-id: 211c0b3e8f3340acd2fae1762d9152a09f19ba34
This commit is contained in:
parent
9adc0a2c3f
commit
cf58a6d860
@ -418,7 +418,8 @@ def get_infer_args(args: Optional[Union[Dict[str, Any], List[str]]] = None) -> _
|
||||
|
||||
if model_args.export_dir is not None and model_args.export_device == "cpu":
|
||||
model_args.device_map = {"": torch.device("cpu")}
|
||||
model_args.model_max_length = data_args.cutoff_len
|
||||
if data_args.cutoff_len != DataArguments().cutoff_len: # override cutoff_len if it is not default
|
||||
model_args.model_max_length = data_args.cutoff_len
|
||||
else:
|
||||
model_args.device_map = "auto"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user