Sentence Similarity
sentence-transformers
Safetensors
xlm-roberta
datadreamer
datadreamer-0.46.0
Synthetic
feature-extraction
text-embeddings-inference
Instructions to use fineinstructions/instruction_template_retrieval_embedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use fineinstructions/instruction_template_retrieval_embedding with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("fineinstructions/instruction_template_retrieval_embedding") 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] - Notebooks
- Google Colab
- Kaggle
Update instruction_template_retriever.py
Browse files
instruction_template_retriever.py
CHANGED
|
@@ -259,7 +259,7 @@ class InstructionTemplateRetriever:
|
|
| 259 |
max_results=250,
|
| 260 |
deduplicate=True,
|
| 261 |
reweight=False,
|
| 262 |
-
|
| 263 |
):
|
| 264 |
"""
|
| 265 |
Given a document
|
|
@@ -277,7 +277,7 @@ class InstructionTemplateRetriever:
|
|
| 277 |
inp0, inp = itertools.tee(inp)
|
| 278 |
first_row = next(inp0)
|
| 279 |
r = Random(first_row[1].item())
|
| 280 |
-
epsilon =
|
| 281 |
bucket = first_row[1]
|
| 282 |
items = []
|
| 283 |
weights = []
|
|
|
|
| 259 |
max_results=250,
|
| 260 |
deduplicate=True,
|
| 261 |
reweight=False,
|
| 262 |
+
reweight_epsilon=0.05,
|
| 263 |
):
|
| 264 |
"""
|
| 265 |
Given a document
|
|
|
|
| 277 |
inp0, inp = itertools.tee(inp)
|
| 278 |
first_row = next(inp0)
|
| 279 |
r = Random(first_row[1].item())
|
| 280 |
+
epsilon = reweight_epsilon
|
| 281 |
bucket = first_row[1]
|
| 282 |
items = []
|
| 283 |
weights = []
|