gilramos commited on
Commit
2d548f2
1 Parent(s): 2ee78a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -19,11 +19,12 @@ model_list = [
19
  #demo = gr.Interface.from_pipeline(pipe)
20
  #demo.launch()
21
 
22
- def predict(chosen_model):
23
 
24
  # Initialize the pipeline with the chosen model
25
  model_pipeline = pipeline("text-classification", model=chosen_model)
26
- label = model_pipeline[0]['label']
 
27
  return label
28
 
29
  inputs = [
 
19
  #demo = gr.Interface.from_pipeline(pipe)
20
  #demo.launch()
21
 
22
+ def predict(text, chosen_model):
23
 
24
  # Initialize the pipeline with the chosen model
25
  model_pipeline = pipeline("text-classification", model=chosen_model)
26
+ result = model_pipeline(text)
27
+ label = result[0]['label']
28
  return label
29
 
30
  inputs = [