Spaces:
Sleeping
Sleeping
Download Dockerfile from hahahararara/LLLL: direct link, hf CLI and curl.
- Browser
- Download file 829 Bytes
-
https://huggingface.co/spaces/hahahararara/LLLL/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/hahahararara/LLLL/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/hahahararara/LLLL/resolve/main/Dockerfile
829 Bytes
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # 1. 部品のインストール | |
| RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt diffusers transformers accelerate safetensors uvicorn | |
| # 2. ファイルの取り込み | |
| COPY . . | |
| # 3. AIが直接画面(HTML)を表示できるようにプログラムを自動改造 | |
| RUN sed -i 's/from fastapi.responses import JSONResponse/from fastapi.responses import JSONResponse, FileResponse/' server.py | |
| RUN printf "\n@app.get('/')\ndef serve_ui():\n return FileResponse('index.html')\n" >> server.py | |
| RUN sed -i 's/value="http:\/\/localhost:8000"/value=""/' index.html | |
| # 4. Hugging Faceのルールで起動 | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] |