fffiloni commited on
Commit
c1d97d2
1 Parent(s): ea2a382

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -31,8 +31,8 @@ def load_model(version):
31
  return MusicGen.get_pretrained(version)
32
 
33
 
34
- def predict(uploaded_image, melody, duration):
35
- text = "à remplacer"
36
  global MODEL
37
  topk = int(250)
38
  if MODEL is None or MODEL.name != "melody":
@@ -94,7 +94,7 @@ with gr.Blocks() as demo:
94
  #split_drums = gr.Audio(type="filepath", label="Drums")
95
  #split_others = gr.Audio(type="filepath", label="Other")
96
  with gr.Row():
97
- uploaded_image = gr.Image(label="Input Image", interactive=True, source="upload", type="filepath")
98
  melody = gr.Audio(source="upload", type="numpy", label="Melody Condition (optional)", interactive=True)
99
  with gr.Row():
100
  submit = gr.Button("Submit")
@@ -110,7 +110,7 @@ with gr.Blocks() as demo:
110
  with gr.Column():
111
  output = gr.Audio(label="Generated Music")
112
  load_sound_btn.click(split_process, inputs=[uploaded_sound], outputs=[melody])
113
- submit.click(predict, inputs=[uploaded_image, melody, duration], outputs=[output])
114
 
115
  gr.Markdown(
116
  """
 
31
  return MusicGen.get_pretrained(version)
32
 
33
 
34
+ def predict(music_prompt, melody, duration):
35
+ text = music_prompt
36
  global MODEL
37
  topk = int(250)
38
  if MODEL is None or MODEL.name != "melody":
 
94
  #split_drums = gr.Audio(type="filepath", label="Drums")
95
  #split_others = gr.Audio(type="filepath", label="Other")
96
  with gr.Row():
97
+ music_prompt = gr.Textbox(label="Musical Prompt", interactive=True)
98
  melody = gr.Audio(source="upload", type="numpy", label="Melody Condition (optional)", interactive=True)
99
  with gr.Row():
100
  submit = gr.Button("Submit")
 
110
  with gr.Column():
111
  output = gr.Audio(label="Generated Music")
112
  load_sound_btn.click(split_process, inputs=[uploaded_sound], outputs=[melody])
113
+ submit.click(predict, inputs=[music_prompt, melody, duration], outputs=[output])
114
 
115
  gr.Markdown(
116
  """