Spaces:
Runtime error
Runtime error
Fixing result error
Browse files
app.py
CHANGED
@@ -21,8 +21,8 @@ def predict(text):
|
|
21 |
|
22 |
outputs = model(**inputs)
|
23 |
predictions = outputs.logits
|
24 |
-
predictionItem = predictions.item()
|
25 |
-
result = torch.sum(
|
26 |
result = max(result, 0)
|
27 |
result = min(result, 5)
|
28 |
return mapping[round(result)]
|
|
|
21 |
|
22 |
outputs = model(**inputs)
|
23 |
predictions = outputs.logits
|
24 |
+
# predictionItem = predictions.item()
|
25 |
+
result = torch.sum(predictions)
|
26 |
result = max(result, 0)
|
27 |
result = min(result, 5)
|
28 |
return mapping[round(result)]
|