Spaces:
inQuestAI
/
Runtime error

fffiloni commited on
Commit
fc4c070
·
verified ·
1 Parent(s): ea0b836

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -20
app.py CHANGED
@@ -124,7 +124,7 @@ def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
124
  "--genre_txt", f"{genre_txt_path}",
125
  "--lyrics_txt", f"{lyrics_txt_path}",
126
  "--run_n_segments", f"{num_segments}",
127
- "--stage2_batch_size", "2",
128
  "--output_dir", f"{output_dir}",
129
  "--cuda_idx", "0",
130
  "--max_new_tokens", f"{max_new_tokens}",
@@ -193,11 +193,22 @@ with gr.Blocks() as demo:
193
  with gr.Column():
194
  genre_txt = gr.Textbox(label="Genre")
195
  lyrics_txt = gr.Textbox(label="Lyrics")
196
- gr.Examples(
197
- examples = [
198
- [
199
- "female blues airy vocal bright vocal piano sad romantic guitar jazz",
200
- """[verse]
 
 
 
 
 
 
 
 
 
 
 
201
  In the quiet of the evening, shadows start to fall
202
  Whispers of the night wind echo through the hall
203
  Lost within the silence, I hear your gentle voice
@@ -208,20 +219,30 @@ Don't let this moment fade, hold me close tonight
208
  With you here beside me, everything's alright
209
  Can't imagine life alone, don't want to let you go
210
  Stay with me forever, let our love just flow
211
- """
212
- ]
213
- ],
214
- inputs = [genre_txt, lyrics_txt]
215
- )
216
- with gr.Column():
217
- if is_shared_ui:
218
- num_segments = gr.Number(label="Number of Song Segments", value=2, interactive=False)
219
- max_new_tokens = gr.Slider(label="Max New Tokens", minimum=500, maximum="24000", step=500, value=3000, interactive=False)
220
- else:
221
- num_segments = gr.Number(label="Number of Song Segments", value=2, interactive=True)
222
- max_new_tokens = gr.Slider(label="Max New Tokens", minimum=500, maximum="24000", step=500, value=3000, interactive=True)
223
- submit_btn = gr.Button("Submit")
224
- music_out = gr.Audio(label="Audio Result")
 
 
 
 
 
 
 
 
 
 
225
 
226
  submit_btn.click(
227
  fn = infer,
 
124
  "--genre_txt", f"{genre_txt_path}",
125
  "--lyrics_txt", f"{lyrics_txt_path}",
126
  "--run_n_segments", f"{num_segments}",
127
+ "--stage2_batch_size", "4",
128
  "--output_dir", f"{output_dir}",
129
  "--cuda_idx", "0",
130
  "--max_new_tokens", f"{max_new_tokens}",
 
193
  with gr.Column():
194
  genre_txt = gr.Textbox(label="Genre")
195
  lyrics_txt = gr.Textbox(label="Lyrics")
196
+
197
+ with gr.Column():
198
+ if is_shared_ui:
199
+ num_segments = gr.Number(label="Number of Song Segments", value=2, interactive=False)
200
+ max_new_tokens = gr.Slider(label="Max New Tokens", minimum=500, maximum="3000", step=500, value=1500, interactive=False)
201
+ else:
202
+ num_segments = gr.Number(label="Number of Song Segments", value=2, interactive=True)
203
+ max_new_tokens = gr.Slider(label="Max New Tokens", minimum=500, maximum="24000", step=500, value=3000, interactive=True)
204
+ submit_btn = gr.Button("Submit")
205
+ music_out = gr.Audio(label="Audio Result")
206
+
207
+ gr.Examples(
208
+ examples = [
209
+ [
210
+ "female blues airy vocal bright vocal piano sad romantic guitar jazz",
211
+ """[verse]
212
  In the quiet of the evening, shadows start to fall
213
  Whispers of the night wind echo through the hall
214
  Lost within the silence, I hear your gentle voice
 
219
  With you here beside me, everything's alright
220
  Can't imagine life alone, don't want to let you go
221
  Stay with me forever, let our love just flow
222
+ """
223
+ ],
224
+ [
225
+ "rap piano street tough piercing vocal hip-hop synthesizer clear vocal male",
226
+ """[verse]
227
+ Woke up in the morning, sun is shining bright
228
+ Chasing all my dreams, gotta get my mind right
229
+ City lights are fading, but my vision's clear
230
+ Got my team beside me, no room for fear
231
+ Walking through the streets, beats inside my head
232
+ Every step I take, closer to the bread
233
+ People passing by, they don't understand
234
+ Building up my future with my own two hands
235
+
236
+ [chorus]
237
+ This is my life, and I'm aiming for the top
238
+ Never gonna quit, no, I'm never gonna stop
239
+ Through the highs and lows, I'mma keep it real
240
+ Living out my dreams with this mic and a deal
241
+ """
242
+ ]
243
+ ],
244
+ inputs = [genre_txt, lyrics_txt]
245
+ )
246
 
247
  submit_btn.click(
248
  fn = infer,