mapecim commited on
Commit
e534788
·
1 Parent(s): 7419339

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -9,7 +9,8 @@ learner = from_pretrained_fastai(repo_id)
9
 
10
  # Definimos una función que se encarga de llevar a cabo las predicciones
11
  def predict(text):
12
- return learner.predict(text)
 
13
 
14
  # Creamos la interfaz y la lanzamos.
15
  gr.Interface(fn=predict, inputs="text", outputs="label", examples=["I loved that movie", "I hated that movie"]).launch()
 
9
 
10
  # Definimos una función que se encarga de llevar a cabo las predicciones
11
  def predict(text):
12
+ pred,pred_idx,probs = learner.predict(text)
13
+ return pred
14
 
15
  # Creamos la interfaz y la lanzamos.
16
  gr.Interface(fn=predict, inputs="text", outputs="label", examples=["I loved that movie", "I hated that movie"]).launch()