nlmaldonadog commited on
Commit
816702a
·
verified ·
1 Parent(s): eb5dbe1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,9 +20,9 @@ labels1 = learner1.dls.vocab
20
 
21
  def predict1(text):
22
  pred,pred_idx,probs = learner1.predict(text)
23
- return {labels1[i]: float(probs[i]) for i in range(len(labels1))}
24
 
25
  texto = gr.Textbox(placeholder='Escribe aquí...')
26
 
27
  # Creamos las interfaces y las lanzamos.
28
- gr.Interface(fn=predict1, inputs=texto, outputs=gr.outputs.Label()).launch(share=True)
 
20
 
21
  def predict1(text):
22
  pred,pred_idx,probs = learner1.predict(text)
23
+ return str({labels1[i]: float(probs[i]) for i in range(len(labels1))})
24
 
25
  texto = gr.Textbox(placeholder='Escribe aquí...')
26
 
27
  # Creamos las interfaces y las lanzamos.
28
+ gr.Interface(fn=predict1, inputs=[texto], outputs="text")).launch(share=True)