Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +2 -0
tasks/text.py
CHANGED
@@ -84,6 +84,7 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
84 |
|
85 |
test_dataset_0 = TensorDataset(test_encodings["input_ids"], test_encodings["attention_mask"], test_labels)
|
86 |
test_loader = DataLoader(test_dataset_0, batch_size=16)
|
|
|
87 |
|
88 |
predictions = []
|
89 |
with torch.no_grad():
|
@@ -92,6 +93,7 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
92 |
outputs = model(input_ids, attention_mask=attention_mask)
|
93 |
preds = torch.argmax(outputs.logits, dim=1)
|
94 |
predictions.extend(preds.cpu().numpy())
|
|
|
95 |
|
96 |
true_labels = test_dataset["label"]
|
97 |
|
|
|
84 |
|
85 |
test_dataset_0 = TensorDataset(test_encodings["input_ids"], test_encodings["attention_mask"], test_labels)
|
86 |
test_loader = DataLoader(test_dataset_0, batch_size=16)
|
87 |
+
print('encoded')
|
88 |
|
89 |
predictions = []
|
90 |
with torch.no_grad():
|
|
|
93 |
outputs = model(input_ids, attention_mask=attention_mask)
|
94 |
preds = torch.argmax(outputs.logits, dim=1)
|
95 |
predictions.extend(preds.cpu().numpy())
|
96 |
+
print('here's a batch')
|
97 |
|
98 |
true_labels = test_dataset["label"]
|
99 |
|