Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -11,10 +11,11 @@ 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 |
def get_training_info(audio_file):
|
15 |
"""Determine training parameters based on the duration of the audio file."""
|
16 |
try:
|
17 |
-
if audio_file
|
18 |
return "Please provide an audio file."
|
19 |
|
20 |
duration = get_audio_duration(audio_file)
|
@@ -37,8 +38,8 @@ def get_training_info(audio_file):
|
|
37 |
|
38 |
return 'Duration is not within the specified range.'
|
39 |
except ValueError as e:
|
40 |
-
raise gr.
|
41 |
-
|
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")
|
|
|
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:
|
18 |
+
if not audio_file:
|
19 |
return "Please provide an audio file."
|
20 |
|
21 |
duration = get_audio_duration(audio_file)
|
|
|
38 |
|
39 |
return 'Duration is not within the specified range.'
|
40 |
except ValueError as e:
|
41 |
+
raise gr.Error(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")
|