Sentence Similarity
sentence-transformers
Safetensors
Transformers
qwen2
feature-extraction
Qwen2
custom_code
text-embeddings-inference
Instructions to use Qodo/Qodo-Embed-1-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Qodo/Qodo-Embed-1-1.5B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Qodo/Qodo-Embed-1-1.5B", trust_remote_code=True) sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use Qodo/Qodo-Embed-1-1.5B with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Qodo/Qodo-Embed-1-1.5B", trust_remote_code=True) model = AutoModel.from_pretrained("Qodo/Qodo-Embed-1-1.5B", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Add exported onnx model 'model.onnx'
#3
by BaumelndesEi - opened
Hello!
This pull request has been automatically generated from the Sentence Transformers backend-export Space.
Pull Request overview
- Add exported ONNX model
model.onnx.
Tip:
Consider testing this pull request before merging by loading the model from this PR with the revision argument:
from sentence_transformers import SentenceTransformer
# TODO: Fill in the PR number
pr_number = 2
model = SentenceTransformer(
"Qodo/Qodo-Embed-1-1.5B",
revision=f"refs/pr/{pr_number}",
backend="onnx",
)
# Verify that everything works as expected
embeddings = model.encode(["The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium."])
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities)