Surn commited on
Commit
2714a6b
·
1 Parent(s): 9634e77

Ensure non-melody models process

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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))