Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,10 @@ audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generati
|
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
12 |
|
13 |
def clean():
|
14 |
-
manual_cap.update(value="",placeholder=ph_message)
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
def infer(image_input, manual_caption, duration_in, seed):
|
19 |
print(duration_in)
|
@@ -105,7 +106,8 @@ with gr.Blocks(css="style.css") as demo:
|
|
105 |
|
106 |
gr.HTML(article)
|
107 |
|
108 |
-
|
|
|
109 |
generate.click(infer, inputs=[input_img, manual_cap, duration_in, seed_in], outputs=[caption_output, sound_output, manual_cap, share_group], api_name="i2fx")
|
110 |
share_button.click(None, [], [], _js=share_js)
|
111 |
|
|
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
12 |
|
13 |
def clean():
|
14 |
+
cleaned_outputs = [manual_cap.update(value="",placeholder=ph_message),
|
15 |
+
caption_output.update(value=None),
|
16 |
+
sound_output.update(value=None)]
|
17 |
+
return cleaned_outputs
|
18 |
|
19 |
def infer(image_input, manual_caption, duration_in, seed):
|
20 |
print(duration_in)
|
|
|
106 |
|
107 |
gr.HTML(article)
|
108 |
|
109 |
+
clean_out = [manual_cap, caption_output, sound_output]
|
110 |
+
input_img.change(clean, None, clean_out)
|
111 |
generate.click(infer, inputs=[input_img, manual_cap, duration_in, seed_in], outputs=[caption_output, sound_output, manual_cap, share_group], api_name="i2fx")
|
112 |
share_button.click(None, [], [], _js=share_js)
|
113 |
|