From 265705f0876812cff00d163b44ced2c10b9bad41 Mon Sep 17 00:00:00 2001 From: w-okada Date: Wed, 27 Sep 2023 02:25:09 +0900 Subject: [PATCH] get model info snipet --- server/GetModelInfo.py | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 server/GetModelInfo.py diff --git a/server/GetModelInfo.py b/server/GetModelInfo.py new file mode 100644 index 00000000..8f0ce28f --- /dev/null +++ b/server/GetModelInfo.py @@ -0,0 +1,43 @@ + +from voice_changer.RVC.RVCModelSlotGenerator import RVCModelSlotGenerator +from voice_changer.VoiceChangerParamsManager import VoiceChangerParamsManager +from voice_changer.utils.LoadModelParams import LoadModelParamFile, LoadModelParams +from voice_changer.utils.VoiceChangerParams import VoiceChangerParams + + +if __name__ == "__main__": + print("main") + voiceChangerParams = VoiceChangerParams( + model_dir="./model_dir/0", # <---- Change HERE + content_vec_500="", + content_vec_500_onnx="", + content_vec_500_onnx_on="", + hubert_base="", + hubert_base_jp="", + hubert_soft="", + nsf_hifigan="", + crepe_onnx_full="", + crepe_onnx_tiny="", + rmvpe="", + rmvpe_onnx="", + sample_mode="" + ) + vcparams = VoiceChangerParamsManager.get_instance() + vcparams.setParams(voiceChangerParams) + + file = LoadModelParamFile( + name="tsukuyomi_v2_40k_e100_simple.onnx", # <---- Change HERE + kind="rvcModel", + dir="", + ) + + loadParam = LoadModelParams( + voiceChangerType="RVC", + files=[file], + slot="", + isSampleMode=False, + sampleId="", + params={}, + ) + slotInfo = RVCModelSlotGenerator.loadModel(loadParam) + print(slotInfo.samplingRate)