mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 05:25:01 +03:00
WIP:Docker
This commit is contained in:
parent
067a7c0296
commit
2fdd3cd099
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,3 +12,5 @@ server/memo.txt
|
|||||||
client/lib/dist
|
client/lib/dist
|
||||||
client/lib/worklet/dist
|
client/lib/worklet/dist
|
||||||
# client/demo/dist/ # demo用に残す
|
# client/demo/dist/ # demo用に残す
|
||||||
|
|
||||||
|
docker/cudnn/
|
@ -1,14 +1,15 @@
|
|||||||
FROM debian:bullseye-slim as base
|
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as base
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y python3-pip git
|
RUN apt-get install -y python3-pip git
|
||||||
RUN apt-get install -y espeak
|
# RUN apt-get install -y espeak
|
||||||
RUN apt-get install -y cmake
|
# RUN apt-get install -y cmake
|
||||||
|
|
||||||
RUN pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
|
#RUN pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
|
||||||
|
|
||||||
|
RUN pip install torch torchvision torchaudio
|
||||||
|
|
||||||
RUN pip install Cython==0.29.32
|
RUN pip install Cython==0.29.32
|
||||||
RUN pip install numpy==1.22.4
|
RUN pip install numpy==1.22.4
|
||||||
@ -29,65 +30,41 @@ RUN pip install python-multipart==0.0.5
|
|||||||
RUN pip install uvicorn==0.18.3
|
RUN pip install uvicorn==0.18.3
|
||||||
RUN pip install websockets==10.4
|
RUN pip install websockets==10.4
|
||||||
RUN pip install pyOpenSSL==23.0.0
|
RUN pip install pyOpenSSL==23.0.0
|
||||||
|
RUN pip install onnxruntime-gpu==1.13.1
|
||||||
|
|
||||||
RUN pip install pyopenjtalk==0.2.0
|
RUN git clone --depth 1 https://github.com/isletennos/MMVC_Trainer.git -b v1.3.2.2
|
||||||
RUN pip install tensorboard==2.10.0
|
|
||||||
|
|
||||||
RUN git clone --depth 1 https://github.com/isletennos/MMVC_Trainer.git -b v1.3.1.3
|
|
||||||
WORKDIR /MMVC_Trainer/monotonic_align
|
WORKDIR /MMVC_Trainer/monotonic_align
|
||||||
RUN cythonize -3 -i core.pyx \
|
RUN python3 setup.py build_ext --inplace
|
||||||
&& mv core.cpython-39-x86_64-linux-gnu.so monotonic_align/
|
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
ADD dummy /
|
ADD dummy /
|
||||||
|
|
||||||
RUN git clone https://github.com/w-okada/voice-changer.git -b v.1.3.0
|
RUN git clone --depth 1 https://github.com/w-okada/voice-changer.git -b v.1.3.0
|
||||||
|
|
||||||
|
|
||||||
|
#FROM debian:bullseye-slim
|
||||||
|
#FROM nvidia/cuda:12.0.0-runtime-ubuntu22.04
|
||||||
|
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y python3-pip espeak gosu libsndfile1-dev\
|
&& apt-get install -y python3-pip espeak gosu libsndfile1-dev emacs \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ### Copy local resource
|
|
||||||
# COPY fine_model/G_180000.pth /MMVC_Trainer/fine_model/G_180000.pth
|
|
||||||
# COPY fine_model/D_180000.pth /MMVC_Trainer/fine_model/D_180000.pth
|
|
||||||
|
|
||||||
### Copy from base
|
### Copy from base
|
||||||
COPY --from=base --chmod=777 /usr/local/lib/python3.9/dist-packages /usr/local/lib/python3.9/dist-packages
|
COPY --from=base --chmod=777 /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
|
||||||
|
|
||||||
COPY --from=base --chmod=777 /voice-changer /voice-changer
|
COPY --from=base --chmod=777 /voice-changer /voice-changer
|
||||||
COPY --from=base --chmod=777 /MMVC_Trainer /voice-changer/server/MMVC_Trainer
|
COPY --from=base --chmod=777 /MMVC_Trainer /voice-changer/server/MMVC_Trainer
|
||||||
|
RUN chmod 0777 /voice-changer/server/MMVC_Trainer
|
||||||
|
RUN chmod 0777 /voice-changer/server
|
||||||
|
|
||||||
|
ADD /setup.sh /voice-changer/server
|
||||||
|
ADD /exec.sh /voice-changer/server
|
||||||
|
|
||||||
|
|
||||||
# # # ### Copy from frontend
|
WORKDIR /voice-changer/server
|
||||||
# # # ##### MMVC Trainer
|
ENTRYPOINT ["/bin/bash", "setup.sh"]
|
||||||
# # # COPY --from=front --chmod=777 /MMVC_Trainer /MMVC_Trainer
|
CMD [ "-h"]
|
||||||
# # # RUN chmod 0777 /MMVC_Trainer
|
|
||||||
|
|
||||||
# # # ADD /setup.sh /MMVC_Trainer/
|
|
||||||
# # # ADD /exec.sh /MMVC_Trainer/
|
|
||||||
|
|
||||||
# # ##### Voice changer Internal
|
|
||||||
# # COPY --from=front --chmod=777 /voice-changer-internal/frontend/dist /voice-changer-internal/frontend/dist
|
|
||||||
# # COPY --from=front --chmod=777 /voice-changer-internal/voice-change-service /voice-changer-internal/voice-change-service
|
|
||||||
# # RUN chmod 0777 /voice-changer-internal/voice-change-service
|
|
||||||
|
|
||||||
# # ADD /setup.sh /voice-changer-internal/voice-change-service/
|
|
||||||
# # ADD /exec.sh /voice-changer-internal/voice-change-service/
|
|
||||||
# # COPY fine_model/G_180000.pth /voice-changer-internal/voice-change-service/MMVC_Trainer/fine_model/G_180000.pth
|
|
||||||
# # COPY fine_model/D_180000.pth /voice-changer-internal/voice-change-service/MMVC_Trainer/fine_model/D_180000.pth
|
|
||||||
|
|
||||||
# # ## 歴史的な経緯でsetup.shをMMVC_Trainerに置いているのでそこを起動時のWORKDIRにしている。
|
|
||||||
# # WORKDIR /voice-changer-internal/voice-change-service
|
|
||||||
|
|
||||||
# # # ##### Soft VC
|
|
||||||
# # # COPY --from=front /hubert /hubert
|
|
||||||
# # # COPY --from=front /acoustic-model /acoustic-model
|
|
||||||
# # # COPY --from=front /hifigan /hifigan
|
|
||||||
# # # COPY --from=front /models /models
|
|
||||||
|
|
||||||
|
|
||||||
# # ENTRYPOINT ["/bin/bash", "setup.sh"]
|
|
||||||
# # CMD [ "-h"]
|
|
||||||
|
@ -13,16 +13,17 @@ echo "PARAMS: $PARAMS"
|
|||||||
# echo "VERBOSE: $VERBOSE"
|
# echo "VERBOSE: $VERBOSE"
|
||||||
echo "------"
|
echo "------"
|
||||||
|
|
||||||
cd /voice-changer-internal/voice-change-service
|
#cd /voice-changer-internal/voice-change-service
|
||||||
# 起動
|
# 起動
|
||||||
if [ "${MODE}" = "MMVC" ] ; then
|
if [ "${MODE}" = "MMVC" ] ; then
|
||||||
if [[ -e /resources/setting.json ]]; then
|
# if [[ -e /resources/setting.json ]]; then
|
||||||
echo "指定された設定(setting.json)を使用します。"
|
# echo "指定された設定(setting.json)を使用します。"
|
||||||
cp /resources/setting.json ../frontend/dist/assets/setting.json
|
# cp /resources/setting.json ../frontend/dist/assets/setting.json
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
find /resources/ -type f -name "config.json" | xargs -I{} sh -c 'echo "config.jsonをコピーします。" && cp {} ./'
|
# find /resources/ -type f -name "config.json" | xargs -I{} sh -c 'echo "config.jsonをコピーします。" && cp {} ./'
|
||||||
find /resources/ -type f -name "*.pth" | xargs -I{} sh -c 'echo "`basename {}`をコピーします。" && cp {} ./'
|
find /resources/ -type f -name "*.pth" | xargs -I{} sh -c 'echo "`basename {}`をコピーします。" && cp {} ./'
|
||||||
|
find /resources/ -type f -name "*.onnx" | xargs -I{} sh -c 'echo "`basename {}`をコピーします。" && cp {} ./'
|
||||||
|
|
||||||
echo "MMVCを起動します"
|
echo "MMVCを起動します"
|
||||||
python3 MMVCServerSIO.py -t MMVC $PARAMS #2>stderr.txt
|
python3 MMVCServerSIO.py -t MMVC $PARAMS #2>stderr.txt
|
||||||
|
@ -115,6 +115,8 @@ class VoiceChanger():
|
|||||||
providers = self.onnx_session.get_providers()
|
providers = self.onnx_session.get_providers()
|
||||||
print("Providers:", providers)
|
print("Providers:", providers)
|
||||||
if "CUDAExecutionProvider" in providers:
|
if "CUDAExecutionProvider" in providers:
|
||||||
|
if self.settings.gpu < 0 or self.settings.gpu >= self.gpu_num:
|
||||||
|
self.settings.gpu = 0
|
||||||
provider_options=[{'device_id': self.settings.gpu}]
|
provider_options=[{'device_id': self.settings.gpu}]
|
||||||
self.onnx_session.set_providers(providers=["CUDAExecutionProvider"], provider_options=provider_options)
|
self.onnx_session.set_providers(providers=["CUDAExecutionProvider"], provider_options=provider_options)
|
||||||
if key == "crossFadeOffsetRate" or key == "crossFadeEndRate":
|
if key == "crossFadeOffsetRate" or key == "crossFadeEndRate":
|
||||||
|
Loading…
Reference in New Issue
Block a user