Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,25 +95,22 @@ with gr.Blocks(css=css_styles) as demo:
|
|
95 |
with gr.Row():
|
96 |
allergies = gr.Textbox(label="Allergies", scale=2, elem_classes=["custom-input1"])
|
97 |
additional_requests = gr.Textbox(label="Anything else you would like to address", scale=2, elem_classes=["custom-input2"])
|
98 |
-
generate_button = gr.Button("Generate Your Cocktail Recipe", scale=
|
|
|
99 |
|
100 |
with gr.Row():
|
101 |
output_recipe = gr.HTML(label="Your Cocktail Recipe")
|
102 |
|
103 |
-
output_recipe = gr.HTML(label="Your Cocktail Recipe")
|
104 |
-
|
105 |
with gr.Row():
|
106 |
play_button = gr.Button("Play Music", visible=False, elem_classes=["generate-button"], scale=4) # Initially not visible
|
107 |
-
|
108 |
-
|
109 |
-
background_music = gr.Audio(label="Background Music", autoplay=True, visible=False) # Initially not visible
|
110 |
|
111 |
def on_generate_click(*args):
|
112 |
recipe, show_play_button = generate_cocktail(*args)
|
113 |
return recipe, gr.update(visible=show_play_button)
|
114 |
|
115 |
def reset():
|
116 |
-
return "", 0, 0, 0, 0, [], [], 10, "", ""
|
117 |
|
118 |
generate_button.click(
|
119 |
fn=on_generate_click,
|
@@ -123,7 +120,7 @@ with gr.Blocks(css=css_styles) as demo:
|
|
123 |
|
124 |
play_button.click(fn=play_music, inputs=[], outputs=[background_music, background_music])
|
125 |
|
126 |
-
clear_button.click(fn=reset, inputs=[], outputs=[mood, sweetness, sour, savory, bitter, flavor_association, drinking_experience, soberness_level, allergies, additional_requests])
|
127 |
|
128 |
if __name__ == "__main__":
|
129 |
demo.launch(#enable_queue=False,
|
|
|
95 |
with gr.Row():
|
96 |
allergies = gr.Textbox(label="Allergies", scale=2, elem_classes=["custom-input1"])
|
97 |
additional_requests = gr.Textbox(label="Anything else you would like to address", scale=2, elem_classes=["custom-input2"])
|
98 |
+
generate_button = gr.Button("Generate Your Cocktail Recipe", scale=0.75, elem_classes=["generate-button"])
|
99 |
+
clear_button = gr.Button("Clear", scale=0.25)
|
100 |
|
101 |
with gr.Row():
|
102 |
output_recipe = gr.HTML(label="Your Cocktail Recipe")
|
103 |
|
|
|
|
|
104 |
with gr.Row():
|
105 |
play_button = gr.Button("Play Music", visible=False, elem_classes=["generate-button"], scale=4) # Initially not visible
|
106 |
+
background_music = gr.Audio(label="Background Music", autoplay=True, visible=False) # Initially not visible
|
|
|
|
|
107 |
|
108 |
def on_generate_click(*args):
|
109 |
recipe, show_play_button = generate_cocktail(*args)
|
110 |
return recipe, gr.update(visible=show_play_button)
|
111 |
|
112 |
def reset():
|
113 |
+
return "", 0, 0, 0, 0, [], [], 10, "", "", "", gr.update(visible=False), gr.update(visible=False)
|
114 |
|
115 |
generate_button.click(
|
116 |
fn=on_generate_click,
|
|
|
120 |
|
121 |
play_button.click(fn=play_music, inputs=[], outputs=[background_music, background_music])
|
122 |
|
123 |
+
clear_button.click(fn=reset, inputs=[], outputs=[mood, sweetness, sour, savory, bitter, flavor_association, drinking_experience, soberness_level, allergies, additional_requests], output_recipe, play_button, background_music)
|
124 |
|
125 |
if __name__ == "__main__":
|
126 |
demo.launch(#enable_queue=False,
|