camillebrl commited on
Commit
43cc0bf
·
verified ·
1 Parent(s): 5267183

Update tasks/text.py

Browse files
Files changed (1) hide show
  1. 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 = [label2id[classifier(quote)[0]["label"]] for quote in test_dataset["quote"]]
71
- print(predictions)
 
 
 
 
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