Spaces:
Running
Running
File size: 1,038 Bytes
6b53a0f 2d49fdd 9b39c01 da16fb8 6a62a4f 6b53a0f c7d4a94 9b39c01 6b53a0f da16fb8 6b53a0f 75f6754 38763a8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
USER root
# for some reason huggingface run container images as uid=1000
RUN useradd -m -u 1000 runtime-user \
&& apt-get update && apt-get install --yes curl libgl1 libglib2.0-0 libgl1-mesa-glx
WORKDIR /app
RUN chown -Rc runtime-user /app
USER runtime-user
RUN mkdir -pv /app/storage \
&& uv venv --clear --python=3.11 /app/venv
RUN curl -L https://github.com/moeflow-com/manga-image-translator/archive/7513db7e8d4a9986e1b186f5fbd2146e39e392d0.tar.gz | tar xvz --strip-components=1
# not caching pip: HF space does not seem to have layer cache anyway
# the extra "setuptools" is necessary to run
RUN UV_PYTHON=venv uv pip install --no-cache -r requirements-moeflow.txt setuptools
# NOTE for unknown reason we need to download here. or there will be runtime file permission error
RUN venv/bin/python docker_prepare.py --models ocr.48px,ocr.48px_ctc,ocr.32px,ocr.mocr,detector.default,detector.ctd,detector.craft,detector.none
CMD ["venv/bin/python", "gradio-main.py"]
|