Update app.py
Browse files
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=
|
|
|
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)
|