mehal commited on
Commit
d7fa53c
1 Parent(s): 90e2561

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -31,10 +31,10 @@ VALID_ZEROSHOT_VIDEOCLASSIFICATION_MODELS = [
31
  processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
32
  model = AutoModel.from_pretrained(DEFAULT_MODEL)
33
 
34
- # def select_model(model_name):
35
- # global processor, model
36
- # processor = AutoProcessor.from_pretrained(model_name)
37
- # model = AutoModel.from_pretrained(model_name)
38
 
39
 
40
  def predict(youtube_url_or_file_path, labels_text):
@@ -79,13 +79,13 @@ with app:
79
 
80
  with gr.Row():
81
  with gr.Column():
82
- # model_names_dropdown = gr.Dropdown(
83
- # choices=VALID_ZEROSHOT_VIDEOCLASSIFICATION_MODELS,
84
- # label="Model:",
85
- # show_label=True,
86
- # value=DEFAULT_MODEL,
87
- # )
88
- # model_names_dropdown.change(fn=select_model, inputs=model_names_dropdown)
89
  with gr.Tab(label="Youtube URL"):
90
  gr.Markdown(
91
  "### **Enter Youtube URL**"
 
31
  processor = AutoProcessor.from_pretrained(DEFAULT_MODEL)
32
  model = AutoModel.from_pretrained(DEFAULT_MODEL)
33
 
34
+ def select_model(model_name):
35
+ global processor, model
36
+ processor = AutoProcessor.from_pretrained(model_name)
37
+ model = AutoModel.from_pretrained(model_name)
38
 
39
 
40
  def predict(youtube_url_or_file_path, labels_text):
 
79
 
80
  with gr.Row():
81
  with gr.Column():
82
+ model_names_dropdown = gr.Dropdown(
83
+ choices=VALID_ZEROSHOT_VIDEOCLASSIFICATION_MODELS,
84
+ label="Model:",
85
+ show_label=True,
86
+ value=DEFAULT_MODEL,
87
+ )
88
+ model_names_dropdown.change(fn=select_model, inputs=model_names_dropdown)
89
  with gr.Tab(label="Youtube URL"):
90
  gr.Markdown(
91
  "### **Enter Youtube URL**"