gilramos commited on
Commit
448041d
1 Parent(s): b827bec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -32,16 +32,10 @@ model_list = [
32
  #demo = gr.Interface.from_pipeline(pipe)
33
  #demo.launch()
34
 
35
- def predict(s1, chosen_model):
36
- # Get model name from user-friendly name
37
- full_chosen_model_name = chosen_model
38
 
39
  # Initialize the pipeline with the chosen model
40
- model_pipeline = pipeline("text-classification", model=full_chosen_model_name)
41
-
42
- # Perform inference on the input text
43
- predicted_label = model_pipeline(s1)[0] # Assuming your model returns a single prediction
44
-
45
  return predicted_label
46
 
47
  inputs = [
 
32
  #demo = gr.Interface.from_pipeline(pipe)
33
  #demo.launch()
34
 
35
+ def predict(chosen_model):
 
 
36
 
37
  # Initialize the pipeline with the chosen model
38
+ predicted_label = pipeline("text-classification", model=chosen_model)
 
 
 
 
39
  return predicted_label
40
 
41
  inputs = [