Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
from xlm_emo.classifier import EmotionClassifier
|
3 |
|
|
|
4 |
|
5 |
def emotionClassifier(text):
|
6 |
ec = EmotionClassifier()
|
7 |
translation = ec.predict([text])
|
8 |
res=translation[0]
|
9 |
return res
|
10 |
-
inputs = gr.inputs.Textbox(
|
11 |
-
outpts=gr.outputs.
|
12 |
|
13 |
-
gr.Interface(emotionClassifier, inputs=inputs,outputs=outpts, title='Emotions Analyser',theme='peach').launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
from xlm_emo.classifier import EmotionClassifier
|
3 |
|
4 |
+
io1 = gr.Interface.load('huggingface/MilaNLProc/xlm-emo-t')
|
5 |
|
6 |
def emotionClassifier(text):
|
7 |
ec = EmotionClassifier()
|
8 |
translation = ec.predict([text])
|
9 |
res=translation[0]
|
10 |
return res
|
11 |
+
inputs = gr.inputs.Textbox(label="Text")
|
12 |
+
outpts=gr.outputs.Textbox(label="Output")
|
13 |
|
14 |
+
#gr.Interface(emotionClassifier, inputs=inputs,outputs=outpts, title='Emotions Analyser',theme='peach').launch()
|
15 |
+
gr.Interface.load(io1, inputs=inputs, title="Emotions Analyser").launch()
|