Spaces:
Build error
Build error
Update src/main.py
Browse files19 unmodified lines2021222324252634 unmodified lines6162636465666768697071725 unmodified lines7879808182838419 unmodified linesrvc_index_path = next((os.path.join(model_dir, f) for f in os.listdir(model_dir) if f.endswith('.index')), None)if rvc_model_path is None:raise FileNotFoundError(f'В каталоге {model_dir} отсутствует файл модели.')return rvc_model_path, rvc_index_path34 unmodified linescrepe_hop_length=128, protect=0.33, output_format='mp3', progress=gr.Progress()):if not uploaded_file or not voice_model:raise ValueError('Убедитесь, что поле ввода песни и поле модели голоса заполнены.')display_progress(0, '[~] Запуск конвейера генерации AI-кавера...', progress)if not os.path.exists(uploaded_file):raise FileNotFoundError(f'{uploaded_file} не существует.')song_id = get_hash(uploaded_file)song_dir = os.path.join(OUTPUT_DIR, song_id)5 unmodified linesif os.path.exists(ai_cover_path):os.remove(ai_cover_path)display_progress(0.5, '[~] Преобразование вокала...', progress)voice_change(voice_model, orig_song_path, ai_cover_path, pitch_change, f0_method, index_rate,filter_radius, rms_mix_rate, protect, crepe_hop_length)19 unmodified lines2021222324252634 unmodified lines6162636465666768697071725 unmodified lines7879808182838419 unmodified linesrvc_index_path = next((os.path.join(model_dir, f) for f in os.listdir(model_dir) if f.endswith('.index')), None)if rvc_model_path is None:raise FileNotFoundError(f'There is no model file in the {model_dir} directory.')return rvc_model_path, rvc_index_path34 unmodified linescrepe_hop_length=128, protect=0.33, output_format='mp3', progress=gr.Progress()):if not uploaded_file or not voice_model:raise ValueError('Make sure that the song input field and voice model field are filled in.')display_progress(0, '[~] Starting the AI cover generation pipeline...', progress)if not os.path.exists(uploaded_file):raise FileNotFoundError(f'{uploaded_file} does not exist.')song_id = get_hash(uploaded_file)song_dir = os.path.join(OUTPUT_DIR, song_id)5 unmodified linesif os.path.exists(ai_cover_path):os.remove(ai_cover_path)display_progress(0.5, '[~] Converting vocals...', progress)voice_change(voice_model, orig_song_path, ai_cover_path, pitch_change, f0_method, index_rate,filter_radius, rms_mix_rate, protect, crepe_hop_length)
src/main.py+5-5