Spaces:
Running
Running
Update src/main.py
Browse files- src/main.py +5 -5
src/main.py
CHANGED
@@ -20,7 +20,7 @@ def get_rvc_model(voice_model):
|
|
20 |
rvc_index_path = next((os.path.join(model_dir, f) for f in os.listdir(model_dir) if f.endswith('.index')), None)
|
21 |
|
22 |
if rvc_model_path is None:
|
23 |
-
raise FileNotFoundError(f'
|
24 |
|
25 |
return rvc_model_path, rvc_index_path
|
26 |
|
@@ -61,12 +61,12 @@ def song_cover_pipeline(uploaded_file, voice_model, pitch_change, index_rate=0.5
|
|
61 |
crepe_hop_length=128, protect=0.33, output_format='mp3', progress=gr.Progress()):
|
62 |
|
63 |
if not uploaded_file or not voice_model:
|
64 |
-
raise ValueError('
|
65 |
|
66 |
-
display_progress(0, '[~]
|
67 |
|
68 |
if not os.path.exists(uploaded_file):
|
69 |
-
raise FileNotFoundError(f'{uploaded_file}
|
70 |
|
71 |
song_id = get_hash(uploaded_file)
|
72 |
song_dir = os.path.join(OUTPUT_DIR, song_id)
|
@@ -78,7 +78,7 @@ def song_cover_pipeline(uploaded_file, voice_model, pitch_change, index_rate=0.5
|
|
78 |
if os.path.exists(ai_cover_path):
|
79 |
os.remove(ai_cover_path)
|
80 |
|
81 |
-
display_progress(0.5, '[~]
|
82 |
voice_change(voice_model, orig_song_path, ai_cover_path, pitch_change, f0_method, index_rate,
|
83 |
filter_radius, rms_mix_rate, protect, crepe_hop_length)
|
84 |
|
|
|
20 |
rvc_index_path = next((os.path.join(model_dir, f) for f in os.listdir(model_dir) if f.endswith('.index')), None)
|
21 |
|
22 |
if rvc_model_path is None:
|
23 |
+
raise FileNotFoundError(f'There is no model file in the {model_dir} directory.')
|
24 |
|
25 |
return rvc_model_path, rvc_index_path
|
26 |
|
|
|
61 |
crepe_hop_length=128, protect=0.33, output_format='mp3', progress=gr.Progress()):
|
62 |
|
63 |
if not uploaded_file or not voice_model:
|
64 |
+
raise ValueError('Make sure that the song input field and voice model field are filled in.')
|
65 |
|
66 |
+
display_progress(0, '[~] Starting the AI cover generation pipeline...', progress)
|
67 |
|
68 |
if not os.path.exists(uploaded_file):
|
69 |
+
raise FileNotFoundError(f'{uploaded_file} does not exist.')
|
70 |
|
71 |
song_id = get_hash(uploaded_file)
|
72 |
song_dir = os.path.join(OUTPUT_DIR, song_id)
|
|
|
78 |
if os.path.exists(ai_cover_path):
|
79 |
os.remove(ai_cover_path)
|
80 |
|
81 |
+
display_progress(0.5, '[~] Converting vocals...', progress)
|
82 |
voice_change(voice_model, orig_song_path, ai_cover_path, pitch_change, f0_method, index_rate,
|
83 |
filter_radius, rms_mix_rate, protect, crepe_hop_length)
|
84 |
|