Skip to content

Commit cc66acd

Browse files
refactor(Dockerfile): 使用虚拟环境安装PyTorch依赖
1 parent 4ee6ba6 commit cc66acd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
# 克隆 ComfyUI 项目
1414
RUN git clone https://github.com/comfyanonymous/ComfyUI.git /ComfyUI
1515

16-
# 安装 PyTorch,指定 ROCm 相关包
17-
RUN pip3 install -v --no-cache-dir torch torchvision torchaudio \
16+
# 创建并激活虚拟环境
17+
RUN python3 -m venv /venv
18+
19+
# 激活虚拟环境并安装 PyTorch 相关依赖
20+
RUN /venv/bin/pip install --no-cache-dir torch torchvision torchaudio \
1821
--index-url https://download.pytorch.org/whl/rocm6.2
1922

2023
# 安装 ComfyUI 项目依赖

0 commit comments

Comments
 (0)