Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,21 +11,25 @@ import gradio as gr
|
|
| 11 |
|
| 12 |
# Cargamos el learner
|
| 13 |
|
| 14 |
-
learner = from_pretrained_fastai('osrojo/
|
| 15 |
|
| 16 |
|
| 17 |
# Definimos las etiquetas de nuestro modelo
|
| 18 |
|
| 19 |
-
labels = ['0','1','2','3']
|
| 20 |
|
| 21 |
|
| 22 |
-
example1 =
|
| 23 |
|
| 24 |
-
example2 = "
|
| 25 |
|
| 26 |
-
example3 = "
|
| 27 |
|
| 28 |
-
example4 = "
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
| 31 |
|
|
@@ -36,4 +40,4 @@ def predict(text):
|
|
| 36 |
|
| 37 |
# Creamos la interfaz y la lanzamos.
|
| 38 |
|
| 39 |
-
gr.Interface(fn=predict, inputs=gr.Textbox(), outputs=gr.Label(),examples=[example1,example2,example3,example4]).launch(share=False)
|
|
|
|
| 11 |
|
| 12 |
# Cargamos el learner
|
| 13 |
|
| 14 |
+
learner = from_pretrained_fastai('osrojo/Emotion')
|
| 15 |
|
| 16 |
|
| 17 |
# Definimos las etiquetas de nuestro modelo
|
| 18 |
|
| 19 |
+
labels = ['0','1','2','3','4','5']
|
| 20 |
|
| 21 |
|
| 22 |
+
example1 = "would like to take the opportunity to describe one day this week when i was feeling particularly gloomy"
|
| 23 |
|
| 24 |
+
example2 = "i believe that feeling accepted in a non judgemental way can be healing"
|
| 25 |
|
| 26 |
+
example3 = "im feeling somewhat nostalgic about the game just from the fact that its star wars"
|
| 27 |
|
| 28 |
+
example4 = "i am most certainly an acquired taste but lately many of those around me have seemed to feel the taste to be bitter"
|
| 29 |
+
|
| 30 |
+
example5 = "i feel shy about it all and also a little concerned whether my new title will distance me away from people i care for"
|
| 31 |
+
|
| 32 |
+
example6 = "i feel like they bring the characters to life completely and i m always kind of surprised what the actors do do together"
|
| 33 |
|
| 34 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
| 35 |
|
|
|
|
| 40 |
|
| 41 |
# Creamos la interfaz y la lanzamos.
|
| 42 |
|
| 43 |
+
gr.Interface(fn=predict, inputs=gr.Textbox(), outputs=gr.Label(),examples=[example1,example2,example3,example4,example5,emample6]).launch(share=False)
|