Zen Embeddings
Collection
Embedding model family for RAG and semantic search. • 7 items • Updated
How to use zenlm/zen-embedding with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("feature-extraction", model="zenlm/zen-embedding") # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("zenlm/zen-embedding")
model = AutoModelForMultimodalLM.from_pretrained("zenlm/zen-embedding")How to use zenlm/zen-embedding with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("zenlm/zen-embedding")
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]High-quality multilingual text embeddings for semantic search and retrieval.
Built on Zen MoDE (Mixture of Distilled Experts) architecture with various parameters and 8K context window.
Developed by Hanzo AI and the Zoo Labs Foundation.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("zenlm/zen-embedding")
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# Compute cosine similarities
similarities = model.similarity(embeddings, embeddings)
print(similarities)
from openai import OpenAI
client = OpenAI(base_url="https://api.hanzo.ai/v1", api_key="your-api-key")
response = client.embeddings.create(model="zen-embedding", input="Your text here")
print(response.data[0].embedding)
| Attribute | Value |
|---|---|
| Parameters | various |
| Architecture | Zen MoDE |
| Context | 8K tokens |
| License | Apache 2.0 |
Apache 2.0