Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +3 -1
tasks/text.py
CHANGED
|
@@ -63,7 +63,9 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
| 63 |
|
| 64 |
#load
|
| 65 |
# Step 1: Use Sentence-BERT to convert text to embeddings
|
| 66 |
-
model = SentenceTransformer("dunzhang/stella_en_400M_v5",trust_remote_code=True
|
|
|
|
|
|
|
| 67 |
|
| 68 |
# Convert each sentence into a vector representation (embedding)
|
| 69 |
embeddings = model.encode(test_dataset['quote'])
|
|
|
|
| 63 |
|
| 64 |
#load
|
| 65 |
# Step 1: Use Sentence-BERT to convert text to embeddings
|
| 66 |
+
model = SentenceTransformer("dunzhang/stella_en_400M_v5",trust_remote_code=True,
|
| 67 |
+
device="cpu",
|
| 68 |
+
config_kwargs={"use_memory_efficient_attention": False, "unpad_inputs": False})
|
| 69 |
|
| 70 |
# Convert each sentence into a vector representation (embedding)
|
| 71 |
embeddings = model.encode(test_dataset['quote'])
|