fix timing bug
Browse files
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]
|
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
|