fffiloni commited on
Commit
e7d2d44
β€’
1 Parent(s): 1b28bbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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)[0]
17
  print(f"""β€”β€”β€”β€”β€”β€”
18
  {result}
19
  """)
20
- return None
 
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():