Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

feat: add server name and port options to Gradio app for enhanced configuration

myhloli9a16d3c74f06
diff --git a/mineru/cli/gradio_app.py b/mineru/cli/gradio_app.py
index 81d94a9a..0b375a4d 100644
--- a/mineru/cli/gradio_app.py
+++ b/mineru/cli/gradio_app.py
@@ -232,7 +232,24 @@ def update_interface(backend_choice):
help="Set the maximum number of pages to convert from PDF to Markdown.",
default=1000,
)
-def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compile_enable, api_enable, max_convert_pages):
+ '--server-name',
+ 'server_name',
+ type=str,
+ help="Set the server name for the Gradio app.",
+ default=None,
+)
+ '--server-port',
+ 'server_port',
+ type=int,
+ help="Set the server port for the Gradio app.",
+ default=None,
+)
+def main(
+ example_enable, sglang_engine_enable, mem_fraction_static, torch_compile_enable, api_enable, max_convert_pages,
+ server_name, server_port
+):
if sglang_engine_enable:
try:
print("Start init SgLang engine...")
@@ -336,7 +353,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
api_name=api_name
)
- demo.launch()
+ demo.launch(server_name=server_name, server_port=server_port, show_api=api_enable)
if __name__ == '__main__':