Feature Extraction
Transformers
Safetensors
sentence-transformers
minicpm
mteb
custom_code
Eval Results (legacy)
Instructions to use openbmb/MiniCPM-Embedding-Light with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-Embedding-Light with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="openbmb/MiniCPM-Embedding-Light", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-Embedding-Light", trust_remote_code=True, dtype="auto") - sentence-transformers
How to use openbmb/MiniCPM-Embedding-Light with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("openbmb/MiniCPM-Embedding-Light", trust_remote_code=True) 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 scripts/test_mteb.py
Browse files- scripts/test_mteb.py +1 -1
scripts/test_mteb.py
CHANGED
|
@@ -352,7 +352,7 @@ class DenseEncoder(torch.nn.Module):
|
|
| 352 |
def __init__(self, **kwargs):
|
| 353 |
super().__init__()
|
| 354 |
|
| 355 |
-
model_path = "openbmb/
|
| 356 |
self.encoder = AutoModel.from_pretrained(model_path, trust_remote_code=True,attn_implementation="flash_attention_2", torch_dtype=torch.float16).to("cuda")
|
| 357 |
self.tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 358 |
self.gpu_count = torch.cuda.device_count()
|
|
|
|
| 352 |
def __init__(self, **kwargs):
|
| 353 |
super().__init__()
|
| 354 |
|
| 355 |
+
model_path = "openbmb/MiniCPM-Embedding-Light"
|
| 356 |
self.encoder = AutoModel.from_pretrained(model_path, trust_remote_code=True,attn_implementation="flash_attention_2", torch_dtype=torch.float16).to("cuda")
|
| 357 |
self.tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 358 |
self.gpu_count = torch.cuda.device_count()
|