Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ def get_audio_duration(audio_file):
|
|
11 |
|
12 |
def get_training_info(audio_file):
|
13 |
if audio_file is None:
|
14 |
-
|
15 |
|
16 |
duration = get_audio_duration(audio_file)
|
17 |
sample_rate = wave.open(audio_file, 'rb').getframerate()
|
@@ -30,7 +30,7 @@ def get_training_info(audio_file):
|
|
30 |
if min_duration <= duration < max_duration:
|
31 |
break
|
32 |
else:
|
33 |
-
|
34 |
|
35 |
return f'You should use the **{pretrain}** pretrain with **{epochs}** epochs at **{sample_rate/1000}kHz** sample rate. Good luck with your training!'
|
36 |
|
|
|
11 |
|
12 |
def get_training_info(audio_file):
|
13 |
if audio_file is None:
|
14 |
+
gr.Error('the audio file pls')
|
15 |
|
16 |
duration = get_audio_duration(audio_file)
|
17 |
sample_rate = wave.open(audio_file, 'rb').getframerate()
|
|
|
30 |
if min_duration <= duration < max_duration:
|
31 |
break
|
32 |
else:
|
33 |
+
gr.Info('Duration is not within the specified range.'
|
34 |
|
35 |
return f'You should use the **{pretrain}** pretrain with **{epochs}** epochs at **{sample_rate/1000}kHz** sample rate. Good luck with your training!'
|
36 |
|