Skip to content

Do not rely on config for inferring model dtype#42838

Merged
Cyrilvallez merged 1 commit intomainfrom
fix-dtype
Dec 12, 2025
Merged

Do not rely on config for inferring model dtype#42838
Cyrilvallez merged 1 commit intomainfrom
fix-dtype

Conversation

@Cyrilvallez
Copy link
Copy Markdown
Member

What does this PR do?

As per the title. Back to what it was before #42805. Relying on the config is an issue in some cases, see #42805 (comment)

@github-actions
Copy link
Copy Markdown
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42838&sha=fcb609

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@Cyrilvallez Cyrilvallez merged commit 5b710c7 into main Dec 12, 2025
24 of 26 checks passed
@Cyrilvallez Cyrilvallez deleted the fix-dtype branch December 12, 2025 14:46
@BenjaminBossan
Copy link
Copy Markdown
Member

Thanks

@tomaarsen
Copy link
Copy Markdown
Member

Thanks for the fix, this also e.g. fixes model.half() saving as "dtype": "float32" via model.save_pretrained(...) in 5.0.0rc01, which broke some tests in Sentence Transformers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants