Skip to content

chore: Optimum - use new import path for SentenceTransformerPoolingLayer#3137

Merged
anakin87 merged 2 commits into
mainfrom
optimum-sentence-transformers-import-fix
Apr 13, 2026
Merged

chore: Optimum - use new import path for SentenceTransformerPoolingLayer#3137
anakin87 merged 2 commits into
mainfrom
optimum-sentence-transformers-import-fix

Conversation

@anakin87
Copy link
Copy Markdown
Member

@anakin87 anakin87 commented Apr 13, 2026

Related Issues

The problem is that Sentence Transformers now has Pooling in a different path. They keep backward compatibility but this does not play well with mypy.

Proposed Changes:

  • use the new import path if available
  • fall back to the old import path to keep compatibility with older Sentence Transformers version

How did you test it?

CI

Checklist

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

Coverage report (optimum)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/optimum/src/haystack_integrations/components/embedders/optimum
  _backend.py 34-35
Project Total  

This report was generated by python-coverage-comment-action

@anakin87 anakin87 self-assigned this Apr 13, 2026
@anakin87 anakin87 marked this pull request as ready for review April 13, 2026 09:00
@anakin87 anakin87 requested a review from a team as a code owner April 13, 2026 09:00
@anakin87 anakin87 requested review from bogdankostic and removed request for a team April 13, 2026 09:00
@anakin87 anakin87 merged commit 7d0aa97 into main Apr 13, 2026
13 checks passed
@anakin87 anakin87 deleted the optimum-sentence-transformers-import-fix branch April 13, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants