📢 WhereIsAI/UAE-Large-V1 遵循MIT许可证。在任何场景下均可自由使用。
如果您在学术论文中使用,可以通过 👉 引用信息 引用我们。
🤝 关注我们:
欢迎使用AnglE进行句子嵌入的训练和推理。
🏆 成就
WhereIsAI/UAE-Large-V1 在MTEB排行榜上取得最先进性能,平均得分为64.64!
🧑🤝🧑 兄弟版本:
```bash
python -m pip install -U angle-emb非检索任务
无需指定任何提示。
from angle_emb import AnglE
from angle_emb.utils import cosine_similarity
angle = 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'
], normalize_embedding=True)
for i, dv1 in enumerate(doc_vecs):
for dv2 in doc_vecs[i+1:]:
print(cosine_similarity(dv1, dv2))为了检索目的,请在查询时使用提示 Prompts.C(不用于文档)。
from angle_emb import AnglE, Prompts
from angle_emb.utils import cosine_similarity
angle = 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(cosine_similarity(qv[0], dv))from angle_emb import Prompts
from sentence_transformers import SentenceTransformer
model = 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))无穷大 是一个遵循 MIT 许可的、适用于 OpenAI 兼容部署的服务器。
docker run --gpus all -v $PWD/data:/app/.cache -p "7997":"7997" \
michaelf34/infinity:latest \
v2 --model-id WhereIsAI/UAE-Large-V1 --revision "369c368f70f16a613f19f5598d4f12d9f44235d4" --dtype float16 --batch-size 32 --device cuda --engine torch --port 7997如果您使用了我们的预训练模型,欢迎通过引用我们的工作来支持我们:
@article{li2023angle,
title={AnglE-optimized Text Embeddings},
author={Li, Xianming and Li, Jing},
journal={arXiv preprint arXiv:2309.12871},
year={2023}
}当然可以,不过我需要您提供原始文本以便进行翻译。请提供您希望翻译成中文的英文文本内容。