Update app.py
Browse files
app.py
CHANGED
@@ -4,17 +4,12 @@ from moviepy.editor import *
|
|
4 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
5 |
|
6 |
caption = gr.Blocks.load(name="spaces/SRDdev/Image-Caption")
|
7 |
-
audio_gen = gr.Blocks.load(name="spaces/
|
8 |
|
9 |
def infer(image_input):
|
10 |
cap = caption(image_input, fn_index=0)
|
11 |
sound = audio_gen(cap, 10, 2.5, 45, 3, fn_index=0)
|
12 |
-
|
13 |
-
FILETOCONVERT = AudioFileClip(sound)
|
14 |
-
time.sleep(2)
|
15 |
-
FILETOCONVERT.write_audiofile("audio.wav")
|
16 |
-
FILETOCONVERT.close()
|
17 |
-
return cap, "audio.wav", gr.Group.update(visible=True)
|
18 |
|
19 |
title = """
|
20 |
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
|
|
4 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
5 |
|
6 |
caption = gr.Blocks.load(name="spaces/SRDdev/Image-Caption")
|
7 |
+
audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generation-clone")
|
8 |
|
9 |
def infer(image_input):
|
10 |
cap = caption(image_input, fn_index=0)
|
11 |
sound = audio_gen(cap, 10, 2.5, 45, 3, fn_index=0)
|
12 |
+
return cap, sound[1], gr.Group.update(visible=True)
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
title = """
|
15 |
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|