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
07eeda10
Commit
07eeda10
authored
Jul 02, 2025
by
myhloli
Browse files
fix: standardize variable naming and improve interface visibility logic in gradio_app.py
parent
5d4263d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
mineru/cli/gradio_app.py
mineru/cli/gradio_app.py
+9
-2
No files found.
mineru/cli/gradio_app.py
View file @
07eeda10
...
@@ -225,7 +225,14 @@ def update_interface(backend_choice):
...
@@ -225,7 +225,14 @@ def update_interface(backend_choice):
help
=
"Enable gradio API for serving the application."
,
help
=
"Enable gradio API for serving the application."
,
default
=
True
,
default
=
True
,
)
)
def
main
(
example_enable
,
sglang_engine_enable
,
mem_fraction_static
,
torch_compile_enable
,
api_enable
):
@
click
.
option
(
'--max-convert-pages'
,
'max_convert_pages'
,
type
=
int
,
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
):
if
sglang_engine_enable
:
if
sglang_engine_enable
:
try
:
try
:
print
(
"Start init SgLang engine..."
)
print
(
"Start init SgLang engine..."
)
...
@@ -257,7 +264,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
...
@@ -257,7 +264,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
with
gr
.
Row
():
with
gr
.
Row
():
input_file
=
gr
.
File
(
label
=
'Please upload a PDF or image'
,
file_types
=
suffixes
)
input_file
=
gr
.
File
(
label
=
'Please upload a PDF or image'
,
file_types
=
suffixes
)
with
gr
.
Row
():
with
gr
.
Row
():
max_pages
=
gr
.
Slider
(
1
,
20
,
10
,
step
=
1
,
label
=
'Max convert pages'
)
max_pages
=
gr
.
Slider
(
1
,
max_convert_pages
,
int
(
max_convert_pages
/
2
)
,
step
=
1
,
label
=
'Max convert pages'
)
with
gr
.
Row
():
with
gr
.
Row
():
if
sglang_engine_enable
:
if
sglang_engine_enable
:
drop_list
=
[
"pipeline"
,
"vlm-sglang-engine"
]
drop_list
=
[
"pipeline"
,
"vlm-sglang-engine"
]
...
...
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