Unverified Commit a53a0c51 authored by Joao Gante's avatar Joao Gante Committed by GitHub
Browse files

Generate: `GenerationConfig.from_pretrained` can return unused kwargs (#27488)

parent 5468ab35
......@@ -750,6 +750,11 @@ class GenerationConfig(PushToHubMixin):
else:
logger.info(f"loading configuration file {configuration_file} from cache at {resolved_config_file}")
if kwargs.get("return_unused_kwargs") is True:
config, unused_kwargs = cls.from_dict(config_dict, **kwargs)
config._original_object_hash = hash(config) # Hash to detect whether the instance was modified
return config, unused_kwargs
else:
config = cls.from_dict(config_dict, **kwargs)
config._original_object_hash = hash(config) # Hash to detect whether the instance was modified
return config
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment