This commit is contained in:
2026-06-16 10:28:49 +08:00
parent 697a0dde24
commit 194b679633
2 changed files with 26 additions and 6 deletions
+19 -4
View File
@@ -6,7 +6,7 @@
# =============================================================================
services:
# --- WebUI 前端(纯前端,通过 nginx 分发到 worker)---
# --- WebUI 前端 ---
gradio:
image: mineru-rocm:7.2.1
profiles: ["gradio"]
@@ -16,15 +16,30 @@ services:
ipc: host
ports:
- "10002:7860"
devices:
- /dev/kfd
- /dev/dri
security_opt:
- seccomp=unconfined
group_add:
- video
environment:
- GRADIO_SERVER_NAME=0.0.0.0
- GRADIO_TEMP_DIR=/tmp/gradio
- MINERU_API_BASE=http://mineru-nginx:8000
- PYTHONPATH=/opt/vllm:${PYTHONPATH:-}
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
volumes:
- ${INPUT_DIR:-./data/input}:/data/input:ro
- ${OUTPUT_DIR:-./data/output}:/data/output
- ${MODEL_DIR:-./data/models}:/opt/models
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
- ./scripts:/opt/scripts:ro
command:
[
"/opt/mineru_venv/bin/python", "/opt/scripts/mineru_webui.py",
"mineru-gradio",
"--server-name", "0.0.0.0",
"--server-port", "7860",
]
depends_on:
- nginx
+7 -2
View File
@@ -207,7 +207,7 @@ def create_ui():
with gr.Row():
with gr.Column(scale=1):
file_input = gr.File(
file_input = gr.UploadButton(
label="Upload PDF",
file_types=[".pdf"],
type="binary",
@@ -242,11 +242,16 @@ def create_ui():
elem_classes=["result-panel"],
)
submit_btn.click(
file_input.upload(
fn=process_pdf,
inputs=[file_input, backend_dd, lang_dd],
outputs=[result_display, status_display, zip_display],
)
submit_btn.click(
fn=lambda f,b,l: "Please use the Upload button above.",
inputs=[file_input, backend_dd, lang_dd],
outputs=[result_display, status_display, zip_display],
)
return demo