amroa commited on
Commit
00a5975
·
1 Parent(s): bfb7f54

fix timing bug

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -124,7 +124,7 @@ def predict(audio, start, end, model_name="BirdAST_Seq"):
124
  if audio_array.shape[0] < start * raw_sr:
125
  raise gr.Error(f"`start` ({start}) must be smaller than audio duration ({len_audio:.0f}s)")
126
 
127
- if audio_array.shape[0] > end * raw_sr:
128
  end = audio_array.shape[0] / (1.0*raw_sr)
129
 
130
  audio_array = np.array(audio_array, dtype=np.float32) / 32768.0
 
124
  if audio_array.shape[0] < start * raw_sr:
125
  raise gr.Error(f"`start` ({start}) must be smaller than audio duration ({len_audio:.0f}s)")
126
 
127
+ if audio_array.shape[0] < end * raw_sr:
128
  end = audio_array.shape[0] / (1.0*raw_sr)
129
 
130
  audio_array = np.array(audio_array, dtype=np.float32) / 32768.0