lauraibnz commited on
Commit
7d49e76
1 Parent(s): ffa9e1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -27,9 +27,10 @@ def predict(midi_file=None, midi_synth=None, prompt="", neg_prompt="", duration=
27
  midi_file = midi_file.name
28
  midi = PrettyMIDI(midi_file)
29
  if not duration or duration == 0:
30
- print("Duration", duration)
31
  duration = midi_synth[1].shape[0]/SAMPLE_RATE
32
- print("New duration", duration)
 
 
33
  audio = pipe(
34
  prompt,
35
  negative_prompt=neg_prompt,
 
27
  midi_file = midi_file.name
28
  midi = PrettyMIDI(midi_file)
29
  if not duration or duration == 0:
 
30
  duration = midi_synth[1].shape[0]/SAMPLE_RATE
31
+ print("Getting duration from MIDI", duration)
32
+ if not prompt and not neg_prompt:
33
+ guess_mode = True
34
  audio = pipe(
35
  prompt,
36
  negative_prompt=neg_prompt,