Spaces:
Running
on
T4
Running
on
T4
Ensure non-melody models process
Browse files
app.py
CHANGED
@@ -236,7 +236,7 @@ def predict(model, text, melody_filepath, duration, dimension, topk, topp, tempe
|
|
236 |
MODEL.set_custom_progress_callback(gr.Progress(track_tqdm=True))
|
237 |
|
238 |
try:
|
239 |
-
if melody:
|
240 |
# return excess duration, load next model and continue in loop structure building up output_segments
|
241 |
if duration > MODEL.lm.cfg.dataset.segment_duration:
|
242 |
output_segments, duration = generate_music_segments(text, melody, seed, MODEL, duration, overlap, MODEL.lm.cfg.dataset.segment_duration, prompt_index, harmony_only=False, progress=gr.Progress(track_tqdm=True))
|
|
|
236 |
MODEL.set_custom_progress_callback(gr.Progress(track_tqdm=True))
|
237 |
|
238 |
try:
|
239 |
+
if melody and ("melody" in model):
|
240 |
# return excess duration, load next model and continue in loop structure building up output_segments
|
241 |
if duration > MODEL.lm.cfg.dataset.segment_duration:
|
242 |
output_segments, duration = generate_music_segments(text, melody, seed, MODEL, duration, overlap, MODEL.lm.cfg.dataset.segment_duration, prompt_index, harmony_only=False, progress=gr.Progress(track_tqdm=True))
|