Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
img_to_text = gr.Blocks.load(name="spaces/pharma/CLIP-Interrogator")
|
4 |
text_to_music = gr.Interface.load("spaces/Mubert/Text-to-Music")
|
@@ -6,6 +7,7 @@ text_to_music = gr.Interface.load("spaces/Mubert/Text-to-Music")
|
|
6 |
def get_prompts(uploaded_image):
|
7 |
prompt = img_to_text(uploaded_image, fn_index=1)[0]
|
8 |
print(prompt)
|
|
|
9 |
music_result = get_music(prompt)
|
10 |
|
11 |
return music_result
|
@@ -13,11 +15,12 @@ def get_prompts(uploaded_image):
|
|
13 |
def get_music(prompt):
|
14 |
email = "[email protected]"
|
15 |
duration = 30
|
16 |
-
result = text_to_music(email, prompt, duration)
|
17 |
print(f"""ββββββ
|
18 |
{result}
|
19 |
""")
|
20 |
-
|
|
|
21 |
|
22 |
with gr.Blocks() as demo:
|
23 |
with gr.Row():
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
|
4 |
img_to_text = gr.Blocks.load(name="spaces/pharma/CLIP-Interrogator")
|
5 |
text_to_music = gr.Interface.load("spaces/Mubert/Text-to-Music")
|
|
|
7 |
def get_prompts(uploaded_image):
|
8 |
prompt = img_to_text(uploaded_image, fn_index=1)[0]
|
9 |
print(prompt)
|
10 |
+
|
11 |
music_result = get_music(prompt)
|
12 |
|
13 |
return music_result
|
|
|
15 |
def get_music(prompt):
|
16 |
email = "[email protected]"
|
17 |
duration = 30
|
18 |
+
result = text_to_music(email, prompt, duration)
|
19 |
print(f"""ββββββ
|
20 |
{result}
|
21 |
""")
|
22 |
+
#output = os.path.join(result, image)
|
23 |
+
return result
|
24 |
|
25 |
with gr.Blocks() as demo:
|
26 |
with gr.Row():
|