Hjgugugjhuhjggg
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def generate_music(text_prompt, audio_file=None, audio_mic=None, tts_text=None):
|
|
18 |
min_duration_sec = 30
|
19 |
max_new_tokens = int(max_duration_sec * model_musicgen.config.min_length)
|
20 |
min_new_tokens = int(min_duration_sec * model_musicgen.config.min_length)
|
21 |
-
audio_values = model_musicgen.generate(**inputs.to("cpu"), max_new_tokens="
|
22 |
music = audio_values.cpu().numpy()[0]
|
23 |
|
24 |
audio_prompt = audio_file or audio_mic
|
|
|
18 |
min_duration_sec = 30
|
19 |
max_new_tokens = int(max_duration_sec * model_musicgen.config.min_length)
|
20 |
min_new_tokens = int(min_duration_sec * model_musicgen.config.min_length)
|
21 |
+
audio_values = model_musicgen.generate(**inputs.to("cpu"), max_new_tokens="1024", min_new_tokens=min_new_tokens)
|
22 |
music = audio_values.cpu().numpy()[0]
|
23 |
|
24 |
audio_prompt = audio_file or audio_mic
|