From f6e40e6061236239d5bedf4c36890d1c83d3314d Mon Sep 17 00:00:00 2001 From: wataru Date: Sat, 29 Apr 2023 07:05:44 +0900 Subject: [PATCH] remove unused import --- docker_vcclient/Dockerfile | 7 ++++++- server/voice_changer/RVC/RVC.py | 8 ++++++-- server/voice_changer/RVC/custom_vc_infer_pipeline.py | 4 ---- start_docker.sh | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docker_vcclient/Dockerfile b/docker_vcclient/Dockerfile index d28b6809..41f924c0 100644 --- a/docker_vcclient/Dockerfile +++ b/docker_vcclient/Dockerfile @@ -64,7 +64,8 @@ RUN pip install websockets==11.0.2 WORKDIR / ADD dummy / -RUN git clone https://github.com/w-okada/voice-changer.git +RUN git clone https://github.com/w-okada/voice-changer.git -b v.1.5.2 + ADD /setup.sh /voice-changer/server ADD /exec.sh /voice-changer/server @@ -73,7 +74,11 @@ RUN chmod 0777 /voice-changer/server WORKDIR /voice-changer/server RUN git clone https://github.com/isletennos/MMVC_Client.git MMVC_Client_v13 +RUN cd MMVC_Client_v13 && git checkout 04f3fec4fd82dea6657026ec4e1cd80fb29a415c && cd - + RUN git clone https://github.com/isletennos/MMVC_Client.git MMVC_Client_v15 +RUN cd MMVC_Client_v15 && git checkout 461cb231b57cbb17243110eaac8435d9cca24a26 && cd - + RUN git clone https://github.com/StarStringStudio/so-vits-svc.git so-vits-svc-40 RUN git clone https://github.com/StarStringStudio/so-vits-svc.git so-vits-svc-40v2 RUN cd so-vits-svc-40v2 && git checkout 08c70ff3d2f7958820b715db2a2180f4b7f92f8d && cd - diff --git a/server/voice_changer/RVC/RVC.py b/server/voice_changer/RVC/RVC.py index 926fcc2d..64b22233 100644 --- a/server/voice_changer/RVC/RVC.py +++ b/server/voice_changer/RVC/RVC.py @@ -313,6 +313,8 @@ class RVC: provider_options=provider_options, ) if key == "modelSlotIndex": + if int(val) < 0: + return True # self.switchModel(int(val)) val = int(val) % 1000 # Quick hack for same slot is selected self.prepareModel(val) @@ -515,6 +517,8 @@ class RVC: del self.net_g del self.onnx_session + print("---------- REMOVING ---------------") + remove_path = os.path.join("RVC") sys.path = [x for x in sys.path if x.endswith(remove_path) is False] @@ -525,8 +529,8 @@ class RVC: if file_path.find("RVC" + os.path.sep) >= 0: print("remove", key, file_path) sys.modules.pop(key) - except Exception as e: - print(e) + except Exception: # type:ignore + # print(e) pass def export2onnx(self): diff --git a/server/voice_changer/RVC/custom_vc_infer_pipeline.py b/server/voice_changer/RVC/custom_vc_infer_pipeline.py index 88360190..0b631040 100644 --- a/server/voice_changer/RVC/custom_vc_infer_pipeline.py +++ b/server/voice_changer/RVC/custom_vc_infer_pipeline.py @@ -3,7 +3,6 @@ import numpy as np # import parselmouth import torch import torch.nn.functional as F -from config import x_query, x_center, x_max # type:ignore import scipy.signal as signal import pyworld @@ -14,9 +13,6 @@ class VC(object): self.window = 160 # 每帧点数 self.t_pad = self.sr * x_pad # 每条前后pad时间 self.t_pad_tgt = tgt_sr * x_pad - self.t_query = self.sr * x_query # 查询切点前后查询时间 - self.t_center = self.sr * x_center # 查询切点位置 - self.t_max = self.sr * x_max # 免查询时长阈值 self.device = device self.is_half = is_half diff --git a/start_docker.sh b/start_docker.sh index 6cb33a8c..4d2179db 100644 --- a/start_docker.sh +++ b/start_docker.sh @@ -1,7 +1,7 @@ #!/bin/bash set -eu -DOCKER_IMAGE=dannadori/vcclient:20230428_190513 +DOCKER_IMAGE=dannadori/vcclient:20230429_061204 #DOCKER_IMAGE=vcclient ### DEFAULT VAR ###