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

Update sentence-transformers and allow setting trust_remote_code #379

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

markstur
Copy link
Contributor

sentence-transformers APIs changed. This update supports 3.0.x (to date). The update is required to support some models.
Most of the update is adding new params to be in sync with the super SentenceTransformer class. Most of these params are not used.

Support is added to allow passing the trust_remote_code parameter. This can be done in the runtime config or with EMBEDDING_TRUST_REMOTE_CODE=true (or =1) environment variable.

sentence-transformers APIs changed. This update allows 3.x (so far).
The update is required to support some models.
Most of the update is adding new params to be in sync with the
super SentenceTransformer class. Most of these params are not used.

Support is added to allow passing the trust_remote_code paramater.
This can be done in the runtime config or with EMBEDDING_TRUST_REMOTE_CODE=true
(or =1) environment variable.

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
Setting PYTORCH_ENABLE_MPS_FALLBACK=1 allows the tests to run on Mac MPS (M3).

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
* Use >= 4.38.0 because that is the sentence-transformers min anyway.
* Add <= 4.44.0 because 4.44.0 breaks our tests with errors like this:
  > `RuntimeError: The expanded size of the tensor (22) must match the existing size (30) at non-singleton dimension 2.  Target sizes: [4, 22, 22].  Tensor sizes: [4, 1, 30]`

Signed-off-by: Mark Sturdevant <mark.sturdevant@ibm.com>
Copy link
Collaborator

@evaline-ju evaline-ju left a comment

Choose a reason for hiding this comment

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

LGTM, we should probably create a separate issue to investigate why transformers 4.44 is breaking though

@evaline-ju evaline-ju merged commit 989cd45 into caikit:main Aug 12, 2024
5 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.

2 participants