mabakaik commited on
Commit
155a163
·
verified ·
1 Parent(s): 7232026

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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=2),
24
- examples=['Ejemplo de texto 1', 'Ejemplo de texto 2']).launch(share=False)
 
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)