Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,14 +2,17 @@ from fastai.text.all import *
|
|
2 |
import gradio as gr
|
3 |
|
4 |
# Cargamos el learner
|
5 |
-
|
|
|
|
|
6 |
|
7 |
# Definimos la funciΓ³n que realiza las predicciones
|
8 |
def predict(text):
|
9 |
-
pred =
|
10 |
return pred
|
11 |
|
12 |
texto1 = 'i can go from feeling so hopeless to so damned hopeful just from being around someone who cares and is awake'
|
13 |
texto2 = 'im grabbing a minute to post i feel greedy wrong'
|
|
|
14 |
# Creamos la interfaz y la lanzamos.
|
15 |
-
gr.Interface(fn=predict, inputs="text", outputs="text",examples=[texto1,texto2]).launch(share=False)
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
# Cargamos el learner
|
5 |
+
|
6 |
+
repo_id = "macapa/emotion-text-classification"
|
7 |
+
learner = from_pretrained_fastai(repo_id)
|
8 |
|
9 |
# Definimos la funciΓ³n que realiza las predicciones
|
10 |
def predict(text):
|
11 |
+
pred = learner.predict(text)
|
12 |
return pred
|
13 |
|
14 |
texto1 = 'i can go from feeling so hopeless to so damned hopeful just from being around someone who cares and is awake'
|
15 |
texto2 = 'im grabbing a minute to post i feel greedy wrong'
|
16 |
+
|
17 |
# Creamos la interfaz y la lanzamos.
|
18 |
+
gr.Interface(fn=predict, inputs="text", outputs="text", examples=[texto1,texto2]).launch(share=False)
|