Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with mixin serialization #2856

Closed
not-lain opened this issue Feb 13, 2025 · 2 comments · Fixed by #2857
Closed

issue with mixin serialization #2856

not-lain opened this issue Feb 13, 2025 · 2 comments · Fixed by #2857
Labels
bug Something isn't working

Comments

@not-lain
Copy link
Contributor

not-lain commented Feb 13, 2025

Describe the bug

not all init parameters are being captured

Reproduction

I was able to identify where the issue is located and here is a very minimalistic reproducer

from huggingface_hub.utils._typing import is_jsonable
from transformers import AutoConfig

cfg = AutoConfig.from_pretrained("Arabic-Clip/bert-base-arabertv2-ViT-B-16-SigLIP-512-epoch-155-trained-2M")
d = cfg.to_dict() #dict 

is_jsonable(d) # False

Logs

irrelevant

System info

- huggingface_hub version: 0.28.1
- Platform: Linux-6.1.85+-x86_64-with-glibc2.35
- Python version: 3.11.11
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Running in Google Colab Enterprise ?: No
- Token path ?: /root/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers: 
- FastAI: 2.7.18
- Tensorflow: 2.18.0
- Torch: 2.5.1+cu124
- Jinja2: 3.1.5
- Graphviz: 0.20.3
- keras: 3.8.0
- Pydot: 3.0.4
- Pillow: 11.1.0
- hf_transfer: N/A
- gradio: N/A
- tensorboard: N/A
- numpy: 1.26.4
- pydantic: 2.10.6
- aiohttp: 3.11.12
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /root/.cache/huggingface/hub
- HF_ASSETS_CACHE: /root/.cache/huggingface/assets
- HF_TOKEN_PATH: /root/.cache/huggingface/token
- HF_STORED_TOKENS_PATH: /root/.cache/huggingface/stored_tokens
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
@not-lain not-lain added the bug Something isn't working label Feb 13, 2025
@not-lain
Copy link
Contributor Author

after some more debugging I was able to find out the root of the issue which stems from having integer keys in dictionaries

from huggingface_hub.utils._typing import is_jsonable
a =  {0: 'LABEL_0', 1: 'LABEL_1'} 
is_jsonable(a) # False

@Wauplin
Copy link
Contributor

Wauplin commented Feb 13, 2025

Thanks for opening the issue. I just opened #2857 to fix this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants