Spaces:
Runtime error
Runtime error
Commit
•
7e90749
1
Parent(s):
5517be7
Add Dockerfile. (#2)
Browse files- Add Dockerfile. (309d5584f81a3bf63a6ad805824119eb50a3339d)
Co-authored-by: Moeta Chen <ixuan789@users.noreply.huggingface.co>
- Docker/Dockerfile +12 -0
- Docker/vits.sh +20 -0
Docker/Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-bullseye
|
2 |
+
VOLUME ["/app"]
|
3 |
+
WORKDIR /app
|
4 |
+
# Set apt to Chinese mirror
|
5 |
+
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
6 |
+
RUN apt-get update && apt-get -y install cmake git
|
7 |
+
RUN git clone https://huggingface.co/spaces/ikechan8370/vits-uma-genshin-honkai
|
8 |
+
WORKDIR /app/vits-uma-genshin-honkai
|
9 |
+
RUN sed -i "s/\.launch()/\.launch(server_name=\"0.0.0.0\")/" /app/vits-uma-genshin-honkai/app.py
|
10 |
+
ADD vits.sh /app/vits.sh
|
11 |
+
EXPOSE 7860
|
12 |
+
ENTRYPOINT [ "/app/vits.sh" ]
|
Docker/vits.sh
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
run() {
|
3 |
+
echo -e "\033[32m已完成初始化,启动服务...\033[0m"
|
4 |
+
python3 /app/vits-uma-genshin-honkai/app.py
|
5 |
+
}
|
6 |
+
install() {
|
7 |
+
echo -e "\033[33m正在初始化:安装依赖....\033[0m"
|
8 |
+
pip install -r /app/vits-uma-genshin-honkai/requirements.txt -i https://mirrors.ustc.edu.cn/pypi/web/simple
|
9 |
+
echo -e "\033[33m正在下载模型....\033[0m"
|
10 |
+
rm -f /app/vits-uma-genshin-honkai/model/G_953000.pth
|
11 |
+
wget -O /app/vits-uma-genshin-honkai/model/G_953000.pth https://huggingface.co/spaces/ikechan8370/vits-uma-genshin-honkai/resolve/main/model/G_953000.pth
|
12 |
+
echo -e "\033[32m初始化完成!\033[0m"
|
13 |
+
run
|
14 |
+
}
|
15 |
+
|
16 |
+
if [ ! -f "/app/vits-uma-genshin-honkai/model/G_953000.pth" ] || [ "$(stat -c%s "/app/vits-uma-genshin-honkai/model/G_953000.pth")" -lt 10000 ]; then
|
17 |
+
install
|
18 |
+
else
|
19 |
+
run
|
20 |
+
fi
|