Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,7 @@ def generate_music(
|
|
119 |
):
|
120 |
if use_audio_prompt and not audio_prompt_path:
|
121 |
raise FileNotFoundError("Please provide an audio prompt filepath when 'use_audio_prompt' is enabled!")
|
122 |
-
max_new_tokens = max_new_tokens *
|
123 |
|
124 |
with tempfile.TemporaryDirectory() as output_dir:
|
125 |
stage1_output_dir = os.path.join(output_dir, "stage1")
|
@@ -326,7 +326,7 @@ def generate_music(
|
|
326 |
return None, None, None
|
327 |
|
328 |
# ------------------ Inference function and Gradio UI ------------------ #
|
329 |
-
def infer(genre_txt_content, lyrics_txt_content, num_segments=
|
330 |
try:
|
331 |
mixed_audio_data, vocal_audio_data, instrumental_audio_data = generate_music(
|
332 |
genre_txt=genre_txt_content,
|
|
|
119 |
):
|
120 |
if use_audio_prompt and not audio_prompt_path:
|
121 |
raise FileNotFoundError("Please provide an audio prompt filepath when 'use_audio_prompt' is enabled!")
|
122 |
+
max_new_tokens = max_new_tokens * 50 # scaling factor
|
123 |
|
124 |
with tempfile.TemporaryDirectory() as output_dir:
|
125 |
stage1_output_dir = os.path.join(output_dir, "stage1")
|
|
|
326 |
return None, None, None
|
327 |
|
328 |
# ------------------ Inference function and Gradio UI ------------------ #
|
329 |
+
def infer(genre_txt_content, lyrics_txt_content, num_segments=2, max_new_tokens=5):
|
330 |
try:
|
331 |
mixed_audio_data, vocal_audio_data, instrumental_audio_data = generate_music(
|
332 |
genre_txt=genre_txt_content,
|