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
6a242ada
Unverified
Commit
6a242ada
authored
Jul 02, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jul 02, 2025
Browse files
Merge pull request #2861 from myhloli/dev
feat: add server name and port options to Gradio app for enhanced con…
parents
e1972f46
9a16d3c7
Changes
1
Show 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 @
6a242ada
...
@@ -232,7 +232,24 @@ def update_interface(backend_choice):
...
@@ -232,7 +232,24 @@ def update_interface(backend_choice):
help
=
"Set the maximum number of pages to convert from PDF to Markdown."
,
help
=
"Set the maximum number of pages to convert from PDF to Markdown."
,
default
=
1000
,
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
:
if
sglang_engine_enable
:
try
:
try
:
print
(
"Start init SgLang engine..."
)
print
(
"Start init SgLang engine..."
)
...
@@ -336,7 +353,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
...
@@ -336,7 +353,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
api_name
=
api_name
api_name
=
api_name
)
)
demo
.
launch
()
demo
.
launch
(
server_name
=
server_name
,
server_port
=
server_port
,
show_api
=
api_enable
)
if
__name__
==
'__main__'
:
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