Sentence Similarity
sentence-transformers
PyTorch
Transformers
English
t5
text-embedding
embeddings
information-retrieval
beir
text-classification
language-model
text-clustering
text-semantic-similarity
text-evaluation
prompt-retrieval
text-reranking
feature-extraction
English
Sentence Similarity
natural_questions
ms_marco
fever
hotpot_qa
mteb
Eval Results (legacy)
Instructions to use t12e/instructor-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use t12e/instructor-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("t12e/instructor-base") 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 t12e/instructor-base with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("t12e/instructor-base") model = AutoModel.from_pretrained("t12e/instructor-base") - Notebooks
- Google Colab
- Kaggle
updated handler.py
Browse files- __pycache__/handler.cpython-310.pyc +0 -0
- handler.py +7 -1
__pycache__/handler.cpython-310.pyc
ADDED
|
Binary file (926 Bytes). View file
|
|
|
handler.py
CHANGED
|
@@ -10,4 +10,10 @@ class EndpointHandler():
|
|
| 10 |
document = data.get("document", "")
|
| 11 |
embedding = self.model.encode([[instruction, document]]).flatten()
|
| 12 |
|
| 13 |
-
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
document = data.get("document", "")
|
| 11 |
embedding = self.model.encode([[instruction, document]]).flatten()
|
| 12 |
|
| 13 |
+
return [
|
| 14 |
+
{
|
| 15 |
+
"embedding": embedding,
|
| 16 |
+
"instruction": instruction,
|
| 17 |
+
"document": document
|
| 18 |
+
}
|
| 19 |
+
]
|