mteb icon indicating copy to clipboard operation
mteb copied to clipboard

remove `sentence-transformers` dependency

Open stephantul opened this issue 2 years ago • 2 comments

as far as I can tell, the sentence-transformers dependency is not necessary for this code to run, only as a shorthand for model loading in cmd. Because installing sentence-transformers also installs torch, sentencepiece, tokenizers and transformers itself, this is quite a big dependency to package. Maybe the installation of sentence-transformers can be split off into an optional dependency?

i.e., pip install mteb[sentencetransformers] could install mteb packaged with sentencetransformers. When running the functionality that requires sentencetransformers, the user could be prompted to install it.

stephantul avatar Apr 02 '23 05:04 stephantul

Good point, some thoughts:

  • Some evaluators use torch (tho could likely use numpy instead in those cases or just add torch to dependencies)
  • transformers/tokenizers/sentencepiece is indeed unnecessary for other models; There are a few sentence_transformers imports that need to be moved into try/except clauses I think

Overall, it should be easily doable & it'd be great to remove some complexity that way. Would you be interested in integrating this? I'd be very happy to help along the way!

Muennighoff avatar Apr 02 '23 08:04 Muennighoff

I'll open a PR to take a stab at it, and will let you know!

stephantul avatar Apr 02 '23 14:04 stephantul

We are currently heavily designed toward sentence transformers. I believe this is a reasonable approach, though we could likely make sentence-transformer an optional dependency. We would welcome a PR on this, but otherwise I will close this issue for now.

KennethEnevoldsen avatar Jun 05 '24 18:06 KennethEnevoldsen