Update app.py
Browse files
app.py
CHANGED
@@ -11,10 +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(input_img):
|
14 |
-
if input_img
|
15 |
return manual_cap.update(value="",placeholder=ph_message), caption_output.update(value=None), sound_output.update(value=None)
|
16 |
else:
|
17 |
-
cap = caption(input_img
|
18 |
print("gpt2 caption: '" + cap + "' β’ ")
|
19 |
ph_update = "gpt2 caption: '" + cap + "' β’ "
|
20 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
|
|
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(input_img):
|
14 |
+
if input_img == None:
|
15 |
return manual_cap.update(value="",placeholder=ph_message), caption_output.update(value=None), sound_output.update(value=None)
|
16 |
else:
|
17 |
+
cap = caption(input_img, fn_index=0)
|
18 |
print("gpt2 caption: '" + cap + "' β’ ")
|
19 |
ph_update = "gpt2 caption: '" + cap + "' β’ "
|
20 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|