Instructions to use WhereIsAI/UAE-Large-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use WhereIsAI/UAE-Large-V1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("WhereIsAI/UAE-Large-V1") 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] - Transformers
How to use WhereIsAI/UAE-Large-V1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="WhereIsAI/UAE-Large-V1")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("WhereIsAI/UAE-Large-V1") model = AutoModel.from_pretrained("WhereIsAI/UAE-Large-V1") - Transformers.js
How to use WhereIsAI/UAE-Large-V1 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'WhereIsAI/UAE-Large-V1'); - Inference
- Notebooks
- Google Colab
- Kaggle
Add modules.json for sentence-transformers
As far as I can tell from the previous discussions, it is OK to use this model with sentence-transformers.
However, since there is no modules.json here, we are faced with the log saying
No sentence-transformers model found with name WhereIsAI/UAE-Large-V1. Creating a new one with MEAN pooling.
while initializing the model.
I think it would be good to have support for sentence-transformers out of the box. Also, as the log message says, it uses mean pooling by default, but from the paper, it seems we would be better of by using the cls pooling strategy, which is also supported by sentence-transformers.
What do you think about adding this to repo?
@mdumandag hi, it supports sentence_transformers now.
from sentence_transformers import SentenceTransformer
st = SentenceTransformers('WhereIsAI/UAE-Large-V1')
st.encode('hello world')
Thank you very much for promptly resolving this. I am closing this now, as it is done