Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,10 @@ caption = gr.Blocks.load(name="spaces/SRDdev/Image-Caption")
|
|
9 |
audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generation-clone", api_key=token)
|
10 |
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
|
|
|
|
|
|
|
|
12 |
def infer(image_input, manual_caption, duration_in, seed):
|
13 |
print(duration_in)
|
14 |
if manual_caption == "":
|
@@ -99,7 +103,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
99 |
|
100 |
gr.HTML(article)
|
101 |
|
102 |
-
input_img.change(manual_cap
|
103 |
generate.click(infer, inputs=[input_img, manual_cap, duration_in, seed_in], outputs=[caption_output, sound_output, manual_cap, share_group], api_name="i2fx")
|
104 |
share_button.click(None, [], [], _js=share_js)
|
105 |
|
|
|
9 |
audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generation-clone", api_key=token)
|
10 |
|
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 |
+
return manual_cap.update(placeholder=ph_message)
|
15 |
+
|
16 |
def infer(image_input, manual_caption, duration_in, seed):
|
17 |
print(duration_in)
|
18 |
if manual_caption == "":
|
|
|
103 |
|
104 |
gr.HTML(article)
|
105 |
|
106 |
+
input_img.change(clean, None, manual_cap)
|
107 |
generate.click(infer, inputs=[input_img, manual_cap, duration_in, seed_in], outputs=[caption_output, sound_output, manual_cap, share_group], api_name="i2fx")
|
108 |
share_button.click(None, [], [], _js=share_js)
|
109 |
|