We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here's the embedding code :
from optimum.onnxruntime import ORTModelForFeatureExtraction from transformers import AutoModel, AutoTokenizer import numpy as np model_ort = ORTModelForFeatureExtraction.from_pretrained('BAAI/bge-small-en-v1.5', file_name="onnx/model.onnx") tokenizer = AutoTokenizer.from_pretrained('BAAI/bge-small-en-v1.5') model = AutoModel.from_pretrained('BAAI/bge-small-en-v1.5') ... inputs = tokenizer(documents, padding=True, truncation=True, return_tensors='pt', max_length=512) embeddings = model(**inputs)[0][:, 0].detach().numpy()
It works but only using cpu, when I tried using to("mps"), it wont work
How can I use mps for this scenario ?
Thanks
The text was updated successfully, but these errors were encountered:
Use the official onnxruntime, this repo is outdated and can be archived.
Sorry, something went wrong.
@henryruhs I see, thanks
No branches or pull requests
Here's the embedding code :
It works but only using cpu, when I tried using to("mps"), it wont work
How can I use mps for this scenario ?
Thanks
The text was updated successfully, but these errors were encountered: