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
Inference Endpoints
Update handler.py
Browse files- handler.py +2 -0
handler.py
CHANGED
@@ -22,5 +22,7 @@ class EndpointHandler():
|
|
22 |
instruction = data.pop("instruction",data)
|
23 |
text = data.pop("text", data)
|
24 |
inputs = [[s, instruction] for s in text]
|
|
|
|
|
25 |
embeddings = self.model.encode(inputs)
|
26 |
return embeddings.tolist()
|
|
|
22 |
instruction = data.pop("instruction",data)
|
23 |
text = data.pop("text", data)
|
24 |
inputs = [[s, instruction] for s in text]
|
25 |
+
if (self.device):
|
26 |
+
inputs = torch.tensor(inputs).to(self.device) # Move inputs to the GPU
|
27 |
embeddings = self.model.encode(inputs)
|
28 |
return embeddings.tolist()
|