Spaces:
Running
on
L40S
Running
on
L40S
FROM lmsysorg/sglang:v0.4.6.post3-cu124 | |
WORKDIR /app | |
RUN useradd -m -u 1000 user | |
COPY <<"EOT" /app/start.sh | |
echo "mineru2.sglang_model.server start..." | |
python3 -m mineru2.sglang_model.server --model-path opendatalab/MinerU2.0-2505-0.9B --port 20000 & | |
while ! timeout 1 bash -c "cat < /dev/null > /dev/tcp/localhost/20000" 2>/dev/null; do | |
sleep 1 | |
done | |
echo "mineru2.gradio_app.webui_std start..." | |
python3 -m mineru2.gradio_app.webui_std --sgl-endpoint http://localhost:20000 | |
EOT | |
ARG CACHEBUST=1 | |
RUN --mount=type=secret,id=SYF_GITHUB_TOKEN,mode=0444,required=true \ | |
git config --global user.name "sunyuefeng" && \ | |
git config --global user.email "[email protected]" && \ | |
git clone https://$(cat /run/secrets/SYF_GITHUB_TOKEN)@github.com/general10/MinerU2.0-Inference.git && \ | |
# python3 -m pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple && \ | |
python3 -m pip install --no-cache-dir ./MinerU2.0-Inference[hf,sglang,gradio] | |
RUN chown user:user -R /app && \ | |
chmod +x /app/start.sh && \ | |
chown -R user:user / || true | |
USER user | |
ENV CUDA_HOME="/usr/local/cuda" | |
CMD ["/app/start.sh"] |