soulteary / docker-prompt-generator

Using a Model to generate prompts for Model applications. / 使用模型来生成作图咒语的偷懒工具,支持 MidJourney、Stable Diffusion 等。
https://soulteary.com/2023/04/05/eighty-lines-of-code-to-implement-the-open-source-midjourney-and-stable-diffusion-spell-drawing-tool.html
MIT License
1.16k stars 111 forks source link

docker build都会报错,手动能解决,但是你的get-models.py文件内容是什么呢? #7

Closed gosber closed 1 year ago

gosber commented 1 year ago

…/docker-prompt-generator    main     3.9.12 (anaconda3)  ╰ docker build -t soulteary/prompt-generator:gpu . -f docker/Dockerfile.gpu [+] Building 0.1s (2/2) FINISHED => [internal] load build definition from Dockerfile.gpu 0.0s => => transferring dockerfile: 41B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 8: FROM requires either one or three arguments

image
soulteary commented 1 year ago

hi,@gosber 这里有两个问题:

第一个问题,构建出错,看起来应该是 Docker 版本的问题,解析 https://github.com/soulteary/docker-prompt-generator/blob/main/docker/Dockerfile.base#L10 这里的执行代码出错。

解决方案是更新 docker 版本。

第二个问题,docker 里的 get-model.py 的内容:

在上面的链接中:

RUN cat > /get-models.py <<EOF
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
AutoModelForSeq2SeqLM.from_pretrained('Helsinki-NLP/opus-mt-zh-en')
AutoTokenizer.from_pretrained('Helsinki-NLP/opus-mt-zh-en')
pipeline('text-generation', model='succinctly/text2image-prompt-generator')
EOF