Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -219,7 +219,7 @@ def generate_music(
|
|
219 |
input_ids=input_ids,
|
220 |
max_new_tokens=max_new_tokens,
|
221 |
min_new_tokens=100,
|
222 |
-
do_sample=
|
223 |
top_p=top_p,
|
224 |
temperature=temperature,
|
225 |
repetition_penalty=repetition_penalty,
|
@@ -227,8 +227,8 @@ def generate_music(
|
|
227 |
pad_token_id=mmtokenizer.eoa,
|
228 |
logits_processor=LogitsProcessorList([BlockTokenRangeProcessor(0, 32002), BlockTokenRangeProcessor(32016, 32016)]),
|
229 |
guidance_scale=guidance_scale,
|
230 |
-
use_cache=True,
|
231 |
-
top_k=50,
|
232 |
num_beams=1
|
233 |
)
|
234 |
if output_seq[0][-1].item() != mmtokenizer.eoa:
|
@@ -290,7 +290,7 @@ def generate_music(
|
|
290 |
for npy in stage1_output_set:
|
291 |
codec_result = np.load(npy)
|
292 |
decodec_rlt = []
|
293 |
-
with torch.
|
294 |
decoded_waveform = codec_model.decode(
|
295 |
torch.as_tensor(codec_result.astype(np.int16), dtype=torch.long).unsqueeze(0).permute(1, 0, 2).to(
|
296 |
device))
|
@@ -419,22 +419,24 @@ with gr.Blocks() as demo:
|
|
419 |
gr.Examples(
|
420 |
examples=[
|
421 |
[
|
422 |
-
"
|
423 |
"""[verse]
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
|
|
|
|
438 |
|
439 |
"""
|
440 |
],
|
|
|
219 |
input_ids=input_ids,
|
220 |
max_new_tokens=max_new_tokens,
|
221 |
min_new_tokens=100,
|
222 |
+
do_sample=False, # just testing what happens
|
223 |
top_p=top_p,
|
224 |
temperature=temperature,
|
225 |
repetition_penalty=repetition_penalty,
|
|
|
227 |
pad_token_id=mmtokenizer.eoa,
|
228 |
logits_processor=LogitsProcessorList([BlockTokenRangeProcessor(0, 32002), BlockTokenRangeProcessor(32016, 32016)]),
|
229 |
guidance_scale=guidance_scale,
|
230 |
+
use_cache=True,
|
231 |
+
# top_k=50,
|
232 |
num_beams=1
|
233 |
)
|
234 |
if output_seq[0][-1].item() != mmtokenizer.eoa:
|
|
|
290 |
for npy in stage1_output_set:
|
291 |
codec_result = np.load(npy)
|
292 |
decodec_rlt = []
|
293 |
+
with torch.inference_mode(), torch.autocast(device_type='cuda', dtype=torch.float16):
|
294 |
decoded_waveform = codec_model.decode(
|
295 |
torch.as_tensor(codec_result.astype(np.int16), dtype=torch.long).unsqueeze(0).permute(1, 0, 2).to(
|
296 |
device))
|
|
|
419 |
gr.Examples(
|
420 |
examples=[
|
421 |
[
|
422 |
+
"Bass Metalcore Thrash Metal Furious bright vocal male Angry aggressive vocal Guitar",
|
423 |
"""[verse]
|
424 |
+
Step back cause I'll ignite
|
425 |
+
Won't quit without a fight
|
426 |
+
No escape, gear up, it's a fierce fight
|
427 |
+
Brace up, raise your hands up and light
|
428 |
+
Fear the might. Step back cause I'll ignite
|
429 |
+
Won't back down without a fight
|
430 |
+
It keeps going and going, the heat is on.
|
431 |
+
|
432 |
+
[chorus]
|
433 |
+
Hot flame. Hot flame.
|
434 |
+
Still here, still holding aim
|
435 |
+
I don't care if I'm bright or dim: nah.
|
436 |
+
I've made it clear, I'll make it again
|
437 |
+
All I want is my crew and my gain.
|
438 |
+
I'm feeling wild, got a bit of rebel style.
|
439 |
+
Locked inside my mind, hot flame.
|
440 |
|
441 |
"""
|
442 |
],
|