You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this error when using vc.get_vc("/home/alcoft/Descargas/Modelos RVC/I4.0 V4/NEKOTSUBA_BI_VOICEVOX.pth").
This is the traceback:
Traceback (most recent call last):
File "/home/alcoft/Projects/Multilang/TAO_I4.0/LibI4/Python_AI/ai_server_all.py", line 1, in <module>
import ai_server
File "/home/alcoft/Projects/Multilang/TAO_I4.0/LibI4/Python_AI/ai_server.py", line 721, in <module>
start_server()
File "/home/alcoft/Projects/Multilang/TAO_I4.0/LibI4/Python_AI/ai_server.py", line 701, in start_server
cb.LoadAllModels()
File "/home/alcoft/Projects/Multilang/TAO_I4.0/LibI4/Python_AI/chatbot_all.py", line 130, in LoadAllModels
rvc.LoadModel()
File "/home/alcoft/Projects/Multilang/TAO_I4.0/LibI4/Python_AI/Inference/RVC_inference.py", line 27, in LoadModel
vc.get_vc("/home/alcoft/Descargas/Modelos RVC/I4.0 V4/NEKOTSUBA_BI_VOICEVOX.pth")
File "/home/alcoft/Projects/Multilang/TAO_I4.0/I4.0_ENV/lib/python3.11/site-packages/rvc/modules/vc/modules.py", line 84, in get_vc
index = get_index_path_from_model(sid)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alcoft/Projects/Multilang/TAO_I4.0/I4.0_ENV/lib/python3.11/site-packages/rvc/modules/vc/utils.py", line 12, in get_index_path_from_model
for root, _, files in os.walk(os.getenv("index_root"), topdown=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen os>", line 343, in walk
TypeError: expected str, bytes or os.PathLike object, not NoneType
My code is:
frompathlibimportPathfromscipy.ioimportwavfilefromrvc.modules.vc.modulesimportVCimportosimporttorchimportjsonimportai_configascfgdevice: str="cpu"vc: VC=VC()
defLoadModel() ->None:
globaldevice, vcif (notcfg.current_data.prompt_order.__contains__("rvc")):
raiseException("Model is not in 'prompt_order'.")
if (cfg.current_data.rvc_method!="rmvpe"andcfg.current_data.rvc_method!="pm"andcfg.current_data.rvc_method!="harvest"andcfg.current_data.rvc_method!="crepe"):
raiseException("RVC method must be 'rmvpe', 'pm', 'harvest' or 'crepe'.")
if (len(cfg.current_data.rvc_model_path) ==0):
returndevice="cuda"if (torch.cuda.is_available() andcfg.current_data.use_gpu_if_availableandcfg.current_data.move_to_gpu.count("rvc") >0) else"cpu"vc.config.device=devicevc.get_vc("/home/alcoft/Descargas/Modelos RVC/I4.0 V4/NEKOTSUBA_BI_VOICEVOX.pth")
def__make_rvc__(audio_name: str, protect: float=0.33, filter_radius: int=3) ->bytes:
LoadModel()
tgt_sr, audio_opt, times, _=vc.vc_single(1, Path(audio_name), f0_method=cfg.current_data.rvc_method, index_file=Path(cfg.current_data.rvc_index_path), filter_radius=filter_radius, protect=protect)
output_file="tmp_rvc_output_"output_file_id=0output_file_path=output_file+str(output_file_id) +".wav"while (os.path.exists(output_file_path)):
output_file_id+=1output_file_path=output_file+str(output_file_id) +".wav"wavfile.write(output_file_path, tgt_sr, audio_opt)
withopen(output_file_path, "wb") asf:
audio_bytes=f.read()
f.close()
os.remove(output_file_path)
returnaudio_bytesdefMakeRVC(data: str|dict[str]) ->bytes:
if (type(data) ==str):
try:
data=json.loads(data)
exceptExceptionasex:
raiseException("[RVC] Data must be a dictionary or a JSON code. ERROR: "+str(ex))
ddata= {
"input": "",
"protect": 0.33,
"filter_radius": 3
}
try:
ddata["input"] =data["input"]
except:
raiseException("Unable to get audio path.")
try:
ddata["protect"] =float(data["protect"])
except:
passtry:
ddata["filter_radius"] =int(data["filter_radius"])
except:
passreturn__make_rvc__(ddata["input"], ddata["protect"], ddata["filter_radius"], ddata["method"])
My Python version is Python 3.11.6 and the model path is /home/alcoft/Descargas/Modelos RVC/I4.0 V4/NEKOTSUBA_BI_VOICEVOX.pth.
Can someone help me fix this?
The text was updated successfully, but these errors were encountered:
You need a .env file, which you can create with rvc env create. Then you need to fill out the paths listed in the .env file, and load the env file with load_dotenv(). You can get the files you need from below (I recommend checking the web-ui repository for more info on setup ), your error is saying you don't have a path to the index file.
Preparation of other Pre-models
RVC requires other pre-models to infer and train.
#Download all needed models from https://huggingface.co/lj1995/VoiceConversionWebUI/tree/main/
python tools/download_models.py
Here's a list of Pre-models and other files that RVC needs:
./assets/hubert/hubert_base.pt
./assets/pretrained
./assets/uvr5_weights
Additional downloads are required if you want to test the v2 version of the model.
./assets/pretrained_v2
If you want to test the v2 version model (the v2 version model has changed the input from the 256 dimensional feature of 9-layer Hubert+final_proj to the 768 dimensional feature of 12-layer Hubert, and has added 3 period discriminators), you will need to download additional features
./assets/pretrained_v2
I have this error when using
vc.get_vc("/home/alcoft/Descargas/Modelos RVC/I4.0 V4/NEKOTSUBA_BI_VOICEVOX.pth")
.This is the traceback:
My code is:
My Python version is
Python 3.11.6
and the model path is/home/alcoft/Descargas/Modelos RVC/I4.0 V4/NEKOTSUBA_BI_VOICEVOX.pth
.Can someone help me fix this?
The text was updated successfully, but these errors were encountered: