Skip to content

fix(exporters): handle read-only config in sentence-transformers >=5#2439

Merged
echarlaix merged 2 commits into
huggingface:mainfrom
SAY-5:fix-sentence-transformers-config
Jun 9, 2026
Merged

fix(exporters): handle read-only config in sentence-transformers >=5#2439
echarlaix merged 2 commits into
huggingface:mainfrom
SAY-5:fix-sentence-transformers-config

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #2438

SentenceTransformer.config is a read-only property in sentence-transformers >=5, so assigning to model.config raises AttributeError. Skip the assignment when not writable and set export_model_type on the underlying transformer config directly.

@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.

@echarlaix echarlaix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot for the fix @SAY-5

@echarlaix
echarlaix merged commit ef69714 into huggingface:main Jun 9, 2026
11 of 15 checks passed
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.

Exporting Models: torch_dtype is deprecated

3 participants