Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +3 -3
tasks/text.py
CHANGED
@@ -72,9 +72,9 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
72 |
predictions = []
|
73 |
|
74 |
for i in range(len(test_dataset["quote"])):
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
|
79 |
# Get true labels
|
80 |
true_labels = test_dataset["label"]
|
|
|
72 |
predictions = []
|
73 |
|
74 |
for i in range(len(test_dataset["quote"])):
|
75 |
+
encoded_input = tokenizer(test_dataset["quote"][i], truncation=True, padding=True, return_tensors="tf")
|
76 |
+
outputs = model(encoded_input["input_ids"], attention_mask=encoded_input["attention_mask"], training=False)
|
77 |
+
predictions.append(tf.argmax(outputs.logits, axis=1))
|
78 |
|
79 |
# Get true labels
|
80 |
true_labels = test_dataset["label"]
|