lauraibnz commited on
Commit
b488dd2
1 Parent(s): bfed5a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -47,8 +47,10 @@ def synthesize(midi_file=None):
47
  midi_synth = midi_synth.reshape(midi_synth.shape[0], 1)
48
  return (SAMPLE_RATE, midi_synth)
49
 
50
- def run_example(midi_file=None, prompt="", neg_prompt="", duration=10, seed=0, cond=1, inf=20, guidance_scale=2.5, guess=False):
51
  midi_synth = synthesize(midi_file)
 
 
52
  gen_audio = predict(midi_file, prompt, neg_prompt, duration, seed, cond, inf, guidance_scale, guess)
53
  return midi_synth, gen_audio
54
 
 
47
  midi_synth = midi_synth.reshape(midi_synth.shape[0], 1)
48
  return (SAMPLE_RATE, midi_synth)
49
 
50
+ def run_example(midi_file=None, prompt="", neg_prompt="", duration=None, seed=0, cond=1, inf=20, guidance_scale=2.5, guess=False):
51
  midi_synth = synthesize(midi_file)
52
+ if not duration:
53
+ duration = midi_synth[1].shape[0]/SAMPLE_RATE
54
  gen_audio = predict(midi_file, prompt, neg_prompt, duration, seed, cond, inf, guidance_scale, guess)
55
  return midi_synth, gen_audio
56