Spaces:
Runtime error
Runtime error
| FROM ghcr.io/astral-sh/uv:python3.11-trixie-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 build-essential libmagic-dev | |
| 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/ced5e5ef161a8ba94c470022f5b31e7914cc0e15.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"] | |