-
Notifications
You must be signed in to change notification settings - Fork 154
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
sentence-transformers-transformer not supported yet with neuron backend #808
Comments
@austinmw could you please share some details on the versions you use, including optium-neuron, transformers, torch-neuronx? cc @JingyaHuang |
Hi @austinmw, Thanks for reporting the issue, the error is introduced by a PR in Optimum main repo: huggingface/optimum#1589, in which the TL,DR
|
Small update on this, the PR for better supporting sentence transformers is merged in optimum-neuron. We built a new modeling API An example snippet here: from transformers import AutoTokenizer
from optimum.neuron import NeuronModelForSenetenceTransformers
tokenizer = AutoTokenizer.from_pretrained("optimum/bge-base-en-v1.5-neuronx")
model = NeuronModelForSenetenceTransformers.from_pretrained("optimum/bge-base-en-v1.5-neuronx")
inputs = tokenizer("In the smouldering promise of the fall of Troy, a mythical world of gods and mortals rises from the ashes.", return_tensors="pt")
outputs = model(**inputs)
token_embeddings = outputs.token_embeddings
sentence_embedding = = outputs.sentence_embedding Please feel free if you want to give it a try by installing optimum-neuron from source. THX |
If you find any further issues please raise in the https://github.com/huggingface/optimum-neuron repo |
@JingyaHuang Awesome, thanks! Btw, very minor, but I noticed a spelling error in the naming of the |
This blog post by HuggingFace says that compiling the BGE model works:
https://www.philschmid.de/inferentia2-embeddings
Yet when I try it, I get the below error.
The text was updated successfully, but these errors were encountered: