Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def predict_emotion(text):
|
|
| 12 |
vocab = learn.dls.vocab[0] if isinstance(learn.dls.vocab[0], list) else learn.dls.vocab
|
| 13 |
probs_dict = {label: float(prob) for label, prob in zip(vocab, probs)}
|
| 14 |
|
| 15 |
-
return pred_label, probs_dict
|
| 16 |
|
| 17 |
# Gradio UI
|
| 18 |
iface = gr.Interface(
|
|
@@ -28,4 +28,4 @@ iface = gr.Interface(
|
|
| 28 |
)
|
| 29 |
|
| 30 |
if __name__ == "__main__":
|
| 31 |
-
iface.launch()
|
|
|
|
| 12 |
vocab = learn.dls.vocab[0] if isinstance(learn.dls.vocab[0], list) else learn.dls.vocab
|
| 13 |
probs_dict = {label: float(prob) for label, prob in zip(vocab, probs)}
|
| 14 |
|
| 15 |
+
return pred_label #, probs_dict
|
| 16 |
|
| 17 |
# Gradio UI
|
| 18 |
iface = gr.Interface(
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
if __name__ == "__main__":
|
| 31 |
+
iface.launch(share=True)
|