Open wAIfu-DEV opened 7 months ago
This indeed seems to be the cause of the crash. I took the liberty to add a print statement in the source code, right before the call to open()
And got the path:
C:\Users\jeje9\Desktop\rvc_test\rvc\lib\uvr5_pack\lib_v5\modelparams\4band_v2.json
when the correct path should have been: C:\Users\jeje9\Desktop\rvc_test\lib\site-packages\rvc\lib\uvr5_pack\lib_v5\modelparams\4band_v2.json
Manually setting the CWD of the python script using os.chdir()
fixes the issue on my end.
import os
import pydub
cwd = os.getcwd()
ffmpeg_exec = cwd + "\\ffmpeg.exe" # or any other path to ffmpeg, as long as it is absolute and not relative.
pydub.AudioSegment.converter = ffmpeg_exec
from dotenv import load_dotenv
from rvc.modules.uvr5.modules import UVR
# downloaded model from:
# https://github.com/TRvlvr/model_repo/releases/
load_dotenv(".env")
print(cwd)
print("Loading UVR")
uvr = UVR()
print("Extracting vocals...")
os.chdir(cwd + "\\Lib\\site-packages")
result = uvr.uvr_wrapper(
model_name="2_HP-UVR.pth",
audio_path=cwd + "\\audio.wav",
save_vocal_path=cwd + "\\vocal",
save_ins_path=cwd + "\\inst",
agg=5,
export_format="wav",
temp_path=cwd + "\\tmp")
for i in result:
print(i)
Sorry it took me so long to notice. I haven't tested it on windows yet, I'll fix it again.
Hi, getting this error when using the UVR.uvr_wrapper() function:
Here is my code:
I made sure to look at the path, and the file does exist, so I'm thinking it might be an issue with the expected CWD since the path is relative. For more info: I'm running python from a venv and using this command to run:
./Scripts/python.exe rvc_test.py
from theC:\Users\jeje9\Desktop\rvc_test
directory where thervc_test.py
file is