Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,6 @@ def get_audio_duration(audio_file):
|
|
11 |
return duration
|
12 |
except wave.Error:
|
13 |
raise ValueError("Invalid audio file. Please upload a valid .wav file.")
|
14 |
-
|
15 |
def get_training_info(audio_file):
|
16 |
"""Determine training parameters based on the duration of the audio file."""
|
17 |
try:
|
@@ -38,8 +37,8 @@ def get_training_info(audio_file):
|
|
38 |
|
39 |
return 'Duration is not within the specified range.'
|
40 |
except ValueError as e:
|
|
|
41 |
return str(e)
|
42 |
-
|
43 |
with gr.Blocks(theme=gr.themes.Base(primary_hue="sky", secondary_hue="blue"), title="RVC TRAINING HELPER") as demo:
|
44 |
with gr.Tab("Main Settings"):
|
45 |
audio_input = gr.Audio(type="filepath", label="Your Audio here")
|
|
|
11 |
return duration
|
12 |
except wave.Error:
|
13 |
raise ValueError("Invalid audio file. Please upload a valid .wav file.")
|
|
|
14 |
def get_training_info(audio_file):
|
15 |
"""Determine training parameters based on the duration of the audio file."""
|
16 |
try:
|
|
|
37 |
|
38 |
return 'Duration is not within the specified range.'
|
39 |
except ValueError as e:
|
40 |
+
return gr.Errors(f"{str(e)}")
|
41 |
return str(e)
|
|
|
42 |
with gr.Blocks(theme=gr.themes.Base(primary_hue="sky", secondary_hue="blue"), title="RVC TRAINING HELPER") as demo:
|
43 |
with gr.Tab("Main Settings"):
|
44 |
audio_input = gr.Audio(type="filepath", label="Your Audio here")
|