Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +6 -2
tasks/text.py
CHANGED
@@ -67,8 +67,12 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
67 |
device="cpu"
|
68 |
)
|
69 |
|
70 |
-
predictions = [
|
71 |
-
|
|
|
|
|
|
|
|
|
72 |
|
73 |
#--------------------------------------------------------------------------------------------
|
74 |
# YOUR MODEL INFERENCE STOPS HERE
|
|
|
67 |
device="cpu"
|
68 |
)
|
69 |
|
70 |
+
predictions = []
|
71 |
+
for batch in range(0, len(test_dataset["quote"]), 32): # Ajustez la taille des batchs
|
72 |
+
batch_quotes = test_dataset["quote"][batch:batch + 32]
|
73 |
+
batch_predictions = classifier(batch_quotes)
|
74 |
+
predictions.extend([label2id[pred["label"]] for pred in batch_predictions])
|
75 |
+
print(predictions)
|
76 |
|
77 |
#--------------------------------------------------------------------------------------------
|
78 |
# YOUR MODEL INFERENCE STOPS HERE
|