Sentence Similarity
Transformers
Safetensors
sentence-transformers
Chinese
utu
feature-extraction
text-embeddings-inference
custom_code
Instructions to use tencent/Youtu-Embedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Youtu-Embedding with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tencent/Youtu-Embedding", trust_remote_code=True, device_map="auto") - sentence-transformers
How to use tencent/Youtu-Embedding with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("tencent/Youtu-Embedding", trust_remote_code=True) sentences = [ "那是 個快樂的人", "那是 條快樂的狗", "那是 個非常幸福的人", "今天是晴天" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
springxchen commited on
Update modeling_utu
Browse files- modeling_utu.py +0 -1
modeling_utu.py
CHANGED
|
@@ -57,7 +57,6 @@ from .configuration_utu import UTUConfig
|
|
| 57 |
|
| 58 |
if is_torch_flex_attn_available():
|
| 59 |
from torch.nn.attention.flex_attention import BlockMask
|
| 60 |
-
|
| 61 |
from transformers.integrations.flex_attention import make_flex_block_causal_mask
|
| 62 |
|
| 63 |
|
|
|
|
| 57 |
|
| 58 |
if is_torch_flex_attn_available():
|
| 59 |
from torch.nn.attention.flex_attention import BlockMask
|
|
|
|
| 60 |
from transformers.integrations.flex_attention import make_flex_block_causal_mask
|
| 61 |
|
| 62 |
|