Add dropdowns in demos
Browse files- examples/best_clubs.py +20 -4
- examples/generate_ad.py +26 -5
- examples/summarize_website.py +14 -3
examples/best_clubs.py
CHANGED
@@ -33,8 +33,24 @@ demo_tasks[DEMO_ID] = tasks
|
|
33 |
|
34 |
def render():
|
35 |
with gr.Tab("Example: Nightlife in NYC"):
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
demo_buttons(demo_id, tasks)
|
|
|
33 |
|
34 |
def render():
|
35 |
with gr.Tab("Example: Nightlife in NYC"):
|
36 |
+
with gr.Box():
|
37 |
+
demo_id = gr.Textbox(DEMO_ID, visible=False)
|
38 |
+
gr.Dropdown(
|
39 |
+
value=CodeTask.name,
|
40 |
+
label="Pick a new Task",
|
41 |
+
interactive=False,
|
42 |
+
)
|
43 |
+
tasks[0].render()
|
44 |
+
gr.Dropdown(
|
45 |
+
value=CodeTask.name,
|
46 |
+
label="Pick a new Task",
|
47 |
+
interactive=False,
|
48 |
+
)
|
49 |
+
tasks[1].render()
|
50 |
+
gr.Dropdown(
|
51 |
+
value=AITask.name,
|
52 |
+
label="Pick a new Task",
|
53 |
+
interactive=False,
|
54 |
+
)
|
55 |
+
tasks[2].render()
|
56 |
demo_buttons(demo_id, tasks)
|
examples/generate_ad.py
CHANGED
@@ -47,9 +47,30 @@ demo_tasks[DEMO_ID] = tasks
|
|
47 |
|
48 |
def render():
|
49 |
with gr.Tab("Example: Generate an ad"):
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
demo_buttons(demo_id, tasks)
|
|
|
47 |
|
48 |
def render():
|
49 |
with gr.Tab("Example: Generate an ad"):
|
50 |
+
with gr.Box():
|
51 |
+
demo_id = gr.Textbox(DEMO_ID, visible=False)
|
52 |
+
gr.Dropdown(
|
53 |
+
value=CodeTask.name,
|
54 |
+
label="Pick a new Task",
|
55 |
+
interactive=False,
|
56 |
+
)
|
57 |
+
tasks[0].render()
|
58 |
+
gr.Dropdown(
|
59 |
+
value=AITask.name,
|
60 |
+
label="Pick a new Task",
|
61 |
+
interactive=False,
|
62 |
+
)
|
63 |
+
tasks[1].render()
|
64 |
+
gr.Dropdown(
|
65 |
+
value=CodeTask.name,
|
66 |
+
label="Pick a new Task",
|
67 |
+
interactive=False,
|
68 |
+
)
|
69 |
+
tasks[2].render()
|
70 |
+
gr.Dropdown(
|
71 |
+
value=AITask.name,
|
72 |
+
label="Pick a new Task",
|
73 |
+
interactive=False,
|
74 |
+
)
|
75 |
+
tasks[3].render()
|
76 |
demo_buttons(demo_id, tasks)
|
examples/summarize_website.py
CHANGED
@@ -19,7 +19,18 @@ demo_tasks[DEMO_ID] = tasks
|
|
19 |
|
20 |
def render():
|
21 |
with gr.Tab("Example: Summarize a website"):
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
demo_buttons(demo_id, tasks)
|
|
|
19 |
|
20 |
def render():
|
21 |
with gr.Tab("Example: Summarize a website"):
|
22 |
+
with gr.Box():
|
23 |
+
demo_id = gr.Textbox(DEMO_ID, visible=False)
|
24 |
+
gr.Dropdown(
|
25 |
+
value=CodeTask.name,
|
26 |
+
label="Pick a new Task",
|
27 |
+
interactive=False,
|
28 |
+
)
|
29 |
+
tasks[0].render()
|
30 |
+
gr.Dropdown(
|
31 |
+
value=AITask.name,
|
32 |
+
label="Pick a new Task",
|
33 |
+
interactive=False,
|
34 |
+
)
|
35 |
+
tasks[1].render()
|
36 |
demo_buttons(demo_id, tasks)
|