Octen-Embedding-8B
215
4
license:apache-2.0
by
bflhc
Embedding Model
OTHER
8B params
New
215 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
18GB+ RAM
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Device Compatibility
Mobile
4-6GB RAM
Laptop
16GB RAM
Server
GPU
Minimum Recommended
8GB+ RAM
Code Examples
Compute similaritypythontransformers
from transformers import AutoModel, AutoTokenizer
import torch
import torch.nn.functional as F
tokenizer = AutoTokenizer.from_pretrained("bflhc/Octen-Embedding-8B", padding_side="left")
model = AutoModel.from_pretrained("bflhc/Octen-Embedding-8B")
model.eval()
def encode(texts):
inputs = tokenizer(texts, padding=True, truncation=True,
max_length=8192, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
# Use last token embedding
embeddings = outputs.last_hidden_state[:, -1, :]
# Normalize embeddings
embeddings = F.normalize(embeddings, p=2, dim=1)
return embeddings
# Example usage
texts = ["Hello world", "你好世界"]
embeddings = encode(texts)
similarity = torch.matmul(embeddings[0], embeddings[1])
print(f"Similarity: {similarity.item():.4f}")Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.