huggingface / huggingface_hub

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

Fix: correctly encode/decode config in ModelHubMixin if custom coders #2337

Closed Wauplin closed 2 weeks ago

Wauplin commented 2 weeks ago

Fix https://github.com/huggingface/huggingface_hub/issues/2334.

Thanks to @not-lain's investigation (see https://github.com/huggingface/huggingface_hub/issues/2334#issuecomment-2167092482), I have been able to reproduce the error with a simple example. The problem was that custom encoders/decoders were not used for the special attribute config. This PR fixes it. I also added a regression test inspired by the reproducible example.

Once merged, I'll make a hot-fix release with this fix.

(failing tests are unrelated)

HuggingFaceDocBuilderDev commented 2 weeks 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.

Wauplin commented 2 weeks ago

Thanks both for the quick review! :hugs: