From be947dfc79854217c9f27b12aef61fb90a34db22 Mon Sep 17 00:00:00 2001 From: Zhang Hao Date: Tue, 26 Aug 2025 18:13:06 +0800 Subject: [PATCH] update readme --- Dockerfile.mrv100 | 2 -- README.md | 25 ++++++++++--------------- run_in_docker.sh | 4 ++-- run_in_docker_bi100.sh | 3 +++ 4 files changed, 15 insertions(+), 19 deletions(-) create mode 100755 run_in_docker_bi100.sh diff --git a/Dockerfile.mrv100 b/Dockerfile.mrv100 index 9d59f2a..cad8f22 100644 --- a/Dockerfile.mrv100 +++ b/Dockerfile.mrv100 @@ -1,7 +1,5 @@ FROM git.modelhub.org.cn:980/enginex-iluvatar/mr100_corex:4.3.0 WORKDIR /workspace -COPY whls-mrv100 /packages RUN pip install diffusers==0.34.0 sentencepiece transformers==4.55.2 -# RUN pip install /packages/*.whl COPY main.py test.sh dataset.json /workspace/ diff --git a/README.md b/README.md index 0f1e953..60ed53c 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,19 @@ -## Installation -参考Dockerfile,构建运行镜像 - ## Quickstart -### 测试程序 -1. 下载模型:https://modelscope.cn/models/AI-ModelScope/stable-diffusion-v1-5 - -2. 运行测试程序 - -修改测试程序`test.py`里面的模型路径,直接执行即可 - +### 构建镜像 ```bash -python3 test.py +docker build -t diffusers:v0.1 . ``` -### 批量测试程序 -1. 准备输入数据集`dataset.json`,可以参考示例`dataset.json` -2. 运行测试程序 +### 模型下载 +模型地址:https://modelscope.cn/models/AI-ModelScope/stable-diffusion-v1-5 +并放到目录:`/mnt/contest_ceph/zhanghao/models/stable-diffusion-v1-5`(如更改目录,请修改后面的执行脚本中的模型路径) + +### 测试程序 +1. 准备输入数据集,可以参考示例`dataset.json` +2. 在docker镜像里运行测试程序,会根据`dataset.json`内容,在`output`目录下生成图片文件。 ```bash -python3 main.py --model "/mnt/contest_ceph/zhanghao/models/stable-diffusion-v1-5" --json "dataset.json" --results "results.json" --outdir "output" --device cuda --dtype fp16 +./run_in_docker.sh ``` ## 测试结果 diff --git a/run_in_docker.sh b/run_in_docker.sh index 2584842..0767548 100755 --- a/run_in_docker.sh +++ b/run_in_docker.sh @@ -1,3 +1,3 @@ #! /usr/bin/env bash -image=harbor-contest.4pd.io/zhanghao/diffusers:bi100-0.2 -docker run -it -v /root/zhanghao:/workspace -v /mnt:/mnt --device=dev/iluvatar1:/dev/iluvatar0 $image bash +image=diffusers:v0.1 +docker run -v /mnt/contest_ceph/zhanghao/models/stable-diffusion-v1-5:/workspace/stable-diffusion-v1-5 --device=dev/iluvatar1:/dev/iluvatar0 $image python3 main.py --model "./stable-diffusion-v1-5" --json "dataset.json" --results "results.json" --outdir "output" --device cuda --dtype fp16 \ No newline at end of file diff --git a/run_in_docker_bi100.sh b/run_in_docker_bi100.sh new file mode 100755 index 0000000..2584842 --- /dev/null +++ b/run_in_docker_bi100.sh @@ -0,0 +1,3 @@ +#! /usr/bin/env bash +image=harbor-contest.4pd.io/zhanghao/diffusers:bi100-0.2 +docker run -it -v /root/zhanghao:/workspace -v /mnt:/mnt --device=dev/iluvatar1:/dev/iluvatar0 $image bash