recipe-sbert-model
48
—
by
moranmiz
Embedding Model
OTHER
New
48 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
Usagebash
pip install -U sentence-transformersUsagepython
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
'Ingredients: 1 head cabbage, cored and shredded, 1/8 cup olive oil. Instructions: Place the shredded cabbage in a large bowl, and drizzle olive oil over it. Toss until evenly coated. Season with garlic powder, lemon juice and cilantro, and stir to blend in all of the flavors.',
'Ingredients: 1/2 cup canola oil, 1/4 cup red wine vinegar, 1 tablespoon soy sauce, 6 tablespoons white sugar, 1 (8 ounce) package shredded cabbage. Instructions: Mix canola oil, red wine vinegar, soy sauce, and sugar in a large bowl, mixing until sugar has dissolved. Toss cabbage, green onions, almonds, and sunflower seed kernels into the dressing. Cover bowl and refrigerate at least 1 hour before serving; slaw tastes better when chilled overnight.',
'Ingredients: 1/4 cup instant cocoa powder, 1 cup shredded coconut, 1/3 cup raisins, 1/2 cup cornflakes cereal, 1/4 cup chopped walnuts, 1 teaspoon sherry, 2 cups vanilla wafer crumbs, 1/4 cup sweetened condensed milk, 3 (1 ounce) squares unsweetened chocolate. Instructions: Lightly butter a 7 or 8 inch square pan. Put all ingredients (except chocolate squares) into mixing bowl: mix well together. Press into pan; smooth surface. Melt chocolate in double broiler; spread evenly over top of mixture. Score with fork. Refrigerate until firm. Cut into small bars.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]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.