Spaces:
Sleeping
Sleeping
Update app.py
Browse fileschanged the output to give only the predicted string class.
app.py
CHANGED
|
@@ -30,7 +30,7 @@ def predict(text):
|
|
| 30 |
predicted_class_id = predictions.argmax().item()
|
| 31 |
confidence = predictions.max().item()
|
| 32 |
category_name = categories[predicted_class_id]
|
| 33 |
-
return
|
| 34 |
|
| 35 |
# Create Gradio interface
|
| 36 |
iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="DistilBERT Text Classifier")
|
|
|
|
| 30 |
predicted_class_id = predictions.argmax().item()
|
| 31 |
confidence = predictions.max().item()
|
| 32 |
category_name = categories[predicted_class_id]
|
| 33 |
+
return category_name
|
| 34 |
|
| 35 |
# Create Gradio interface
|
| 36 |
iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="DistilBERT Text Classifier")
|