Spaces:
Build error
Build error
Commit
·
2d94f6c
1
Parent(s):
b32806b
fixbug dockerfile
Browse files- Dockerfile +18 -18
Dockerfile
CHANGED
@@ -1,42 +1,42 @@
|
|
1 |
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
|
2 |
|
3 |
-
#
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
git \
|
6 |
wget \
|
7 |
ffmpeg \
|
8 |
libsndfile1 \
|
9 |
python3-pip \
|
|
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
#
|
13 |
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh \
|
14 |
&& bash miniconda.sh -b -p /opt/conda \
|
15 |
&& rm miniconda.sh
|
16 |
|
17 |
-
# Add conda to path
|
18 |
ENV PATH=/opt/conda/bin:$PATH
|
19 |
|
20 |
-
#
|
21 |
RUN conda create -n mimictalk python=3.9 -y
|
22 |
-
SHELL ["conda", "run", "-n", "mimictalk", "/bin/bash", "-c"]
|
23 |
|
24 |
-
#
|
25 |
-
RUN pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
|
30 |
-
#
|
31 |
COPY requirements.txt /tmp/
|
32 |
-
RUN pip install -r /tmp/requirements.txt
|
33 |
|
34 |
-
#
|
35 |
-
RUN pip install huggingface_hub \
|
36 |
-
|
37 |
|
38 |
-
#
|
|
|
39 |
WORKDIR /app
|
40 |
|
41 |
-
#
|
42 |
-
CMD ["conda", "run", "--no-capture-output", "-n", "mimictalk", "python", "inference/app_mimictalk.py"]
|
|
|
1 |
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
|
2 |
|
3 |
+
# 基础依赖
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
git \
|
6 |
wget \
|
7 |
ffmpeg \
|
8 |
libsndfile1 \
|
9 |
python3-pip \
|
10 |
+
bzip2 \
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# 安装 Miniconda
|
14 |
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh \
|
15 |
&& bash miniconda.sh -b -p /opt/conda \
|
16 |
&& rm miniconda.sh
|
17 |
|
|
|
18 |
ENV PATH=/opt/conda/bin:$PATH
|
19 |
|
20 |
+
# 创建 conda 环境
|
21 |
RUN conda create -n mimictalk python=3.9 -y
|
|
|
22 |
|
23 |
+
# 显式使用 conda run 安装依赖(不设置 SHELL)
|
24 |
+
RUN conda run -n mimictalk pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
|
25 |
+
RUN conda run -n mimictalk pip install cython openmim==0.3.9
|
26 |
+
RUN conda run -n mimictalk mim install mmcv==2.1.0
|
27 |
+
RUN conda run -n mimictalk pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
|
28 |
|
29 |
+
# 安装项目依赖
|
30 |
COPY requirements.txt /tmp/
|
31 |
+
RUN conda run -n mimictalk pip install -r /tmp/requirements.txt
|
32 |
|
33 |
+
# 下载模型文件
|
34 |
+
RUN conda run -n mimictalk pip install huggingface_hub && \
|
35 |
+
conda run -n mimictalk python -c "from huggingface_hub import snapshot_download; snapshot_download('mrbear1024/demo-model', local_dir='/app/models')"
|
36 |
|
37 |
+
# 拷贝项目代码
|
38 |
+
COPY . /app
|
39 |
WORKDIR /app
|
40 |
|
41 |
+
# 启动命令
|
42 |
+
CMD ["/opt/conda/bin/conda", "run", "--no-capture-output", "-n", "mimictalk", "python", "inference/app_mimictalk.py"]
|