Instructions to use codefuse-ai/ML-Embed-0.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codefuse-ai/ML-Embed-0.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="codefuse-ai/ML-Embed-0.6B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("codefuse-ai/ML-Embed-0.6B") model = AutoModel.from_pretrained("codefuse-ai/ML-Embed-0.6B", device_map="auto") - sentence-transformers
How to use codefuse-ai/ML-Embed-0.6B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("codefuse-ai/ML-Embed-0.6B") 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] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -227,7 +227,7 @@ In general, for retrieval and reranking tasks:
|
|
| 227 |
- use the prompt for **queries**
|
| 228 |
- do **not** prepend the prompt to **documents/passages**
|
| 229 |
|
| 230 |
-
For symmetric tasks such as STS, clustering, and bitext mining, you can encode the documents either with or without prompts. The model is trained to support scenarios.
|
| 231 |
|
| 232 |
|
| 233 |
## Efficient Deployment
|
|
|
|
| 227 |
- use the prompt for **queries**
|
| 228 |
- do **not** prepend the prompt to **documents/passages**
|
| 229 |
|
| 230 |
+
For symmetric tasks such as STS, clustering, and bitext mining, you can encode the documents either with or without prompts. The model is trained to support both scenarios.
|
| 231 |
|
| 232 |
|
| 233 |
## Efficient Deployment
|