Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from fastai.vision.all import *
|
|
8 |
repo_id = "mabakaik/clasificadorTexto"
|
9 |
|
10 |
learner = from_pretrained_fastai(repo_id)
|
11 |
-
labels = learner.dls.vocab
|
12 |
|
13 |
if isinstance(labels, list) and all(isinstance(label, list) for label in labels):
|
14 |
labels = [item for sublist in labels for item in sublist]
|
@@ -20,5 +20,5 @@ def predict(text):
|
|
20 |
|
21 |
# Creamos la interfaz y la lanzamos.
|
22 |
gr.Interface(fn=predict, inputs=gr.inputs.Textbox(lines=5, placeholder="Introduce tu texto aquí..."),
|
23 |
-
outputs=gr.outputs.Label(num_top_classes=
|
24 |
-
examples=['
|
|
|
8 |
repo_id = "mabakaik/clasificadorTexto"
|
9 |
|
10 |
learner = from_pretrained_fastai(repo_id)
|
11 |
+
labels = learner.dls.vocab[1]
|
12 |
|
13 |
if isinstance(labels, list) and all(isinstance(label, list) for label in labels):
|
14 |
labels = [item for sublist in labels for item in sublist]
|
|
|
20 |
|
21 |
# Creamos la interfaz y la lanzamos.
|
22 |
gr.Interface(fn=predict, inputs=gr.inputs.Textbox(lines=5, placeholder="Introduce tu texto aquí..."),
|
23 |
+
outputs=gr.outputs.Label(num_top_classes=4),
|
24 |
+
examples=['What is this?', 'That is awfull']).launch(share=False)
|