KingNish commited on
Commit
e511f97
·
verified ·
1 Parent(s): be7bfa2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -124,7 +124,7 @@ def generate_music(
124
  genre_txt=None,
125
  lyrics_txt=None,
126
  run_n_segments=3,
127
- max_new_tokens=50,
128
  use_audio_prompt=False,
129
  audio_prompt_path="",
130
  prompt_start_time=0.0,
@@ -162,7 +162,7 @@ def generate_music(
162
  # Decoding config
163
  top_p = 0.93
164
  temperature = 1.0
165
- repetition_penalty = 1.2
166
  start_of_segment = mmtokenizer.tokenize('[start_of_segment]')
167
  end_of_segment = mmtokenizer.tokenize('[end_of_segment]')
168
 
@@ -221,7 +221,7 @@ def generate_music(
221
  logits_processor=LogitsProcessorList([BlockTokenRangeProcessor(0, 32002), BlockTokenRangeProcessor(32016, 32016)]),
222
  guidance_scale=guidance_scale,
223
  use_cache=True,
224
- num_beams=1
225
  )
226
  if output_seq[0][-1].item() != mmtokenizer.eoa:
227
  tensor_eoa = torch.as_tensor([[mmtokenizer.eoa]]).to(model.device)
@@ -368,10 +368,10 @@ Woke up in the morning, sun is shining bright
368
  Chasing all my dreams, gotta get my mind right
369
  City lights are fading, but my vision's clear
370
  Got my team beside me, no room for fear
371
- Walking through the streets, beats inside my head
372
- Every step I take, closer to the bread
373
 
374
  [chorus]
 
 
375
  This is my life, and I'm aiming for the top
376
  Never gonna quit, no, I'm never gonna stop
377
  Through the highs and lows, I'mma keep it real
 
124
  genre_txt=None,
125
  lyrics_txt=None,
126
  run_n_segments=3,
127
+ max_new_tokens=45,
128
  use_audio_prompt=False,
129
  audio_prompt_path="",
130
  prompt_start_time=0.0,
 
162
  # Decoding config
163
  top_p = 0.93
164
  temperature = 1.0
165
+ repetition_penalty = 1.1
166
  start_of_segment = mmtokenizer.tokenize('[start_of_segment]')
167
  end_of_segment = mmtokenizer.tokenize('[end_of_segment]')
168
 
 
221
  logits_processor=LogitsProcessorList([BlockTokenRangeProcessor(0, 32002), BlockTokenRangeProcessor(32016, 32016)]),
222
  guidance_scale=guidance_scale,
223
  use_cache=True,
224
+ num_beams = 3 if i > 1 else 1
225
  )
226
  if output_seq[0][-1].item() != mmtokenizer.eoa:
227
  tensor_eoa = torch.as_tensor([[mmtokenizer.eoa]]).to(model.device)
 
368
  Chasing all my dreams, gotta get my mind right
369
  City lights are fading, but my vision's clear
370
  Got my team beside me, no room for fear
 
 
371
 
372
  [chorus]
373
+ Walking through the streets, beats inside my head
374
+ Every step I take, closer to the bread
375
  This is my life, and I'm aiming for the top
376
  Never gonna quit, no, I'm never gonna stop
377
  Through the highs and lows, I'mma keep it real