huggingface / huggingface_hub

The official Python client for the Huggingface Hub.
https://huggingface.co/docs/huggingface_hub
Apache License 2.0
1.83k stars 471 forks source link

Don't override 'config' in model_kwargs #2274

Closed alexander-soare closed 1 month ago

alexander-soare commented 1 month ago

It's possible someone wants to use from_pretrained but have the ability to override the config stored in the model repository (see point 2 here for an example use case). In this case, they might want to use ModelCls.from_pretrained("hub/id", model_kwargs={"config": myconfig}). This PR makes sure that "config" is not overriden by from_pretrained

HuggingFaceDocBuilderDev commented 1 month ago

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.