Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
9a16d3c7
Commit
9a16d3c7
authored
Jul 02, 2025
by
myhloli
Browse files
feat: add server name and port options to Gradio app for enhanced configuration
parent
b78551af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
mineru/cli/gradio_app.py
mineru/cli/gradio_app.py
+19
-2
No files found.
mineru/cli/gradio_app.py
View file @
9a16d3c7
...
...
@@ -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
):
@
click
.
option
(
'--server-name'
,
'server_name'
,
type
=
str
,
help
=
"Set the server name for the Gradio app."
,
default
=
None
,
)
@
click
.
option
(
'--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__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment