ahmedghani commited on
Commit
5106d98
·
1 Parent(s): 61b37a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -2
app.py CHANGED
@@ -3,6 +3,36 @@ import json
3
  import requests
4
  import pandas as pd
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  def update_regions(provider):
7
  available_regions = []
8
 
@@ -297,13 +327,15 @@ with gr.Blocks() as interface:
297
  """)
298
 
299
  with gr.Row():
300
- task_selector = gr.Textbox(
 
301
  value="Custom",
302
  interactive=True,
303
  show_label=False,
304
  )
305
 
306
- framework_selector = gr.Textbox(
 
307
  value="Custom",
308
  interactive=True,
309
  show_label=False,
@@ -507,6 +539,7 @@ with gr.Blocks() as interface:
507
  )
508
 
509
  # Deploy Tab Events
 
510
  provider_selector.change(update_regions, inputs=provider_selector, outputs=region_selector)
511
  region_selector.change(update_compute_options, inputs=[provider_selector, region_selector], outputs=compute_selector)
512
  submit_button.click(
 
3
  import requests
4
  import pandas as pd
5
 
6
+ def update_task_options(framework):
7
+ config = {
8
+ "Custom":["Custom"],
9
+ "Diffusers":["Text To Image"],
10
+ "Transformers":[
11
+ "Text Classification",
12
+ "Zero Shot Classification",
13
+ "Token Classifiation",
14
+ "Question Answering",
15
+ "Fill Mask",
16
+ "Summarization",
17
+ "Translation",
18
+ "Text to Text Generation",
19
+ "Text Generation",
20
+ "Feature Extraction",
21
+ "Image Classification",
22
+ "Automatic Speech Recognition",
23
+ "Audio Classification",
24
+ "Object Detection",
25
+ "Image Segmentation",
26
+ "Table Question Answering",
27
+ "Conversational",
28
+ "Visual Question Answering",
29
+ "Zero Shot Image Classification"]
30
+ }
31
+ return gr.Dropdown.update(
32
+ choices=config[framework],
33
+ value=config[framework][0] if len(config[framework]) > 0 else None
34
+ )
35
+
36
  def update_regions(provider):
37
  available_regions = []
38
 
 
327
  """)
328
 
329
  with gr.Row():
330
+ framework_selector = gr.Dropdown(
331
+ choices = ["Custom", "Diffusers", "Transformers"],
332
  value="Custom",
333
  interactive=True,
334
  show_label=False,
335
  )
336
 
337
+ task_selector = gr.Dropdown(
338
+ [],
339
  value="Custom",
340
  interactive=True,
341
  show_label=False,
 
539
  )
540
 
541
  # Deploy Tab Events
542
+ framework_selector.change(update_task_options, inputs=framework_selector, outputs=task_selector)
543
  provider_selector.change(update_regions, inputs=provider_selector, outputs=region_selector)
544
  region_selector.change(update_compute_options, inputs=[provider_selector, region_selector], outputs=compute_selector)
545
  submit_button.click(