Spaces:
Running
Running
fix id labeling
Browse files- interfaces/sentiment.py +1 -1
interfaces/sentiment.py
CHANGED
@@ -43,7 +43,7 @@ def predict(text, model_id, tokenizer_id):
|
|
43 |
predicted_class_id = {4: 2, 5: 1}.get(predicted_class_id, 0)
|
44 |
|
45 |
|
46 |
-
output_pred =
|
47 |
|
48 |
|
49 |
output_info = f'<p style="text-align: center; display: block">Prediction was made using the <a href="https://huggingface.co/{model_id}">{model_id}</a> model.</p>'
|
|
|
43 |
predicted_class_id = {4: 2, 5: 1}.get(predicted_class_id, 0)
|
44 |
|
45 |
|
46 |
+
output_pred = model.config.id2label[predicted_class_id]
|
47 |
|
48 |
|
49 |
output_info = f'<p style="text-align: center; display: block">Prediction was made using the <a href="https://huggingface.co/{model_id}">{model_id}</a> model.</p>'
|