Feature Extraction
sentence-transformers
ONNX
Safetensors
OpenVINO
Transformers
Transformers.js
English
bert
mteb
sentence_embedding
feature_extraction
Eval Results (legacy)
text-embeddings-inference
Run this model with HF Jobs
Run WhereIsAI/UAE-Large-V1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/WhereIsAI/UAE-Large-V1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/WhereIsAI/UAE-Large-V1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("WhereIsAI/UAE-Large-V1") model = AutoModel.from_pretrained("WhereIsAI/UAE-Large-V1", device_map="auto") - 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 sentence transformer usage
Browse files2621 unmodified lines26222623262426252626262726281 unmodified line26302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602621 unmodified lines# Usage```bashpython -m pip install -U angle-emb1 unmodified line1) Non-Retrieval Tasks```pythonfrom angle_emb import AnglEangle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1', pooling_strategy='cls').cuda()vec = angle.encode('hello world', to_numpy=True)print(vec)vecs = angle.encode(['hello world1', 'hello world2'], to_numpy=True)print(vecs)```2) Retrieval TasksFor retrieval purposes, please use the prompt `Prompts.C`.```pythonfrom angle_emb import AnglE, Promptsangle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1', pooling_strategy='cls').cuda()angle.set_prompt(prompt=Prompts.C)vec = angle.encode({'text': 'hello world'}, to_numpy=True)print(vec)vecs = angle.encode([{'text': 'hello world1'}, {'text': 'hello world2'}], to_numpy=True)print(vecs)```# CitationIf you use our pre-trained models, welcome to support us by citing our work:2621 unmodified lines26222623262426252626262726281 unmodified line2630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952621 unmodified lines# Usage## 1. angle_emb```bashpython -m pip install -U angle-emb1 unmodified line1) Non-Retrieval TasksThere is no need to specify any prompts.```pythonfrom angle_emb import AnglEfrom scipy import spatialangle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1', pooling_strategy='cls').cuda()doc_vecs = angle.encode(['The weather is great!','The weather is very good!','i am going to bed'])for i, dv1 in enumerate(doc_vecs):for dv2 in doc_vecs[i+1:]:print(1 - spatial.distance.cosine(dv1, dv2))```2) Retrieval TasksFor retrieval purposes, please use the prompt `Prompts.C` for query (not for document).```pythonfrom angle_emb import AnglE, Promptsfrom scipy import spatialangle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1', pooling_strategy='cls').cuda()qv = angle.encode(Prompts.C.format(text='what is the weather?'))doc_vecs = angle.encode(['The weather is great!','it is rainy today.','i am going to bed'])for dv in doc_vecs:print(1 - spatial.distance.cosine(qv[0], dv))```## 2. sentence transformer```pythonfrom angle_emb import Promptsfrom sentence_transformers import SentenceTransformermodel = SentenceTransformer("WhereIsAI/UAE-Large-V1").cuda()qv = model.encode(Prompts.C.format(text='what is the weather?'))doc_vecs = model.encode(['The weather is great!','it is rainy today.','i am going to bed'])for dv in doc_vecs:print(1 - spatial.distance.cosine(qv, dv))```# CitationIf you use our pre-trained models, welcome to support us by citing our work:
README.md+46-11