Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,7 @@ import gradio as gr
|
|
6 |
learn = load_learner('export.pkl')
|
7 |
|
8 |
# Definimos las etiquetas de nuestro modelo
|
9 |
-
labels =
|
10 |
-
|
11 |
|
12 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
13 |
def predict(txt):
|
@@ -15,5 +14,5 @@ def predict(txt):
|
|
15 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
16 |
|
17 |
# Creamos la interfaz y la lanzamos.
|
18 |
-
gr.Interface(fn=predict, inputs=
|
19 |
-
|
|
|
6 |
learn = load_learner('export.pkl')
|
7 |
|
8 |
# Definimos las etiquetas de nuestro modelo
|
9 |
+
labels = ["anger", "joy", "optimism", "sadness"]
|
|
|
10 |
|
11 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
12 |
def predict(txt):
|
|
|
14 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
15 |
|
16 |
# Creamos la interfaz y la lanzamos.
|
17 |
+
gr.Interface(fn=predict, inputs="text", outputs=gr.outputs.Label(),examples=["@user but your pussy was weak from what I heard so stfu up to me bitch . You got to threaten him that your pregnant .\n", "Worry is a down payment on a problem you may never have. Joyce Meyer. #motivation #leadership #worry\n", "My roommate: it's okay that we can't spell because we have autocorrect. #terrible #firstworldprobs\n", "it's pretty depressing when u hit pan on ur favourite highlighter\n", "Tiller and breezy should do a collab album. Rapping and singing prolly be fire\n"]).launch(share=False)
|
18 |
+
|