Instructions to use Haon-Chen/e5-omni-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Haon-Chen/e5-omni-3B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Haon-Chen/e5-omni-3B") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Avoid trust_remote_code with transformers v5.6.0
Hello!
Pull Request overview
- Drop the
auto_mapshim andmodeling_e5_omni.pyre-export, and removetrust_remote_code=Truefrom the README snippet - Fix
sentence_bert_config.json:transformer_taskshould now be"any-to-any"as we need to import withAutoModelForMultimodalLMinstead ofAutoModel - Pin
transformers>=5.6.0in the README install line and inconfig_sentence_transformers.json
Details
This is a follow-up to #2. That PR required trust_remote_code=True because qwen2_5_omni_thinker could not be loaded out-of-the-box by AutoConfig/AutoModel, which was worked around via a modeling_e5_omni.py re-export plus an auto_map entry in config.json. I resolved that directly on transformers, so this model (and its siblings) can now be loaded without any trust_remote_code=True, custom modeling file, or auto_map entry.
To avoid that, I made a PR on transformers, which has now been merged and released in transformers v5.6.0, which allows this model and its siblings to be loaded without trust_remote_code=True. The changes are rather small, and the model has the same outputs as before.
- Tom Aarsen