saruizn commited on
Commit
2a3f88e
·
1 Parent(s): 652914d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -13,13 +13,13 @@ def predict(txt):
13
  pred,pred_idx,probs = learner.predict(txt)
14
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
15
 
16
- ejemploActualidad="An Elusive Peace in Najaf The standoff is driven by Moqtada Sadr's political ambitions. But how good is his poker game?"
17
- ejemploDeportes="Rathbone is #39;like Gregan #39; AUSTRALIAN coach Eddie Jones rates winger Clyde Rathbone a potential successor to Wallaby captain George Gregan as the pair reach Test career milestones tonight against South Africa in Durban. "
18
- ejemploNegocios="Kmart #39;s store sales might cost jobs Report: Retailer could terminate as many as 1,200 positions stemming from stores sold to Home Depot. "
19
- ejemploCiencia="RealNetworks Doesn #39;t Rock NEW YORK - It #39;s never a smart move to pick a public fight with Apple Computer, and it #39;s doubly unwise if that fight involves the iPod in some way. "
20
 
21
 
22
  # Creamos la interfaz y la lanzamos.
23
- gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(128, 128)), outputs=gr.outputs.Label(num_top_classes=3),examples=[ejemploActualidad,ejemploDeportes,ejemploNegocios,ejemploCiencia]).launch(share=False)
24
 
25
 
 
13
  pred,pred_idx,probs = learner.predict(txt)
14
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
15
 
16
+ ejemploActualidad="Actualidad.txt"
17
+ ejemploDeportes="Deportes.txt"
18
+ ejemploNegocios="Negocios.txt"
19
+ ejemploCiencia="Ciencia.txt"
20
 
21
 
22
  # Creamos la interfaz y la lanzamos.
23
+ gr.Interface(fn=predict, inputs="text", outputs=gr.outputs.Label(num_top_classes=3),examples=[ejemploActualidad,ejemploDeportes,ejemploNegocios,ejemploCiencia]).launch(share=False)
24
 
25