PVK-Varma commited on
Commit
4ac500d
·
verified ·
1 Parent(s): 9787d86

Update app.py

Browse files

changed the output to give only the predicted string class.

Files changed (1) hide show
  1. app.py +1 -1
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 f"Category: {category_name}\nConfidence: {confidence:.4f}"
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")