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
7c95c62d
Commit
7c95c62d
authored
Jul 01, 2025
by
myhloli
Browse files
fix: change default value for torch compile option and clean up code
parent
89107628
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
mineru/cli/gradio_app.py
mineru/cli/gradio_app.py
+3
-4
No files found.
mineru/cli/gradio_app.py
View file @
7c95c62d
...
@@ -209,14 +209,14 @@ def update_interface(backend_choice):
...
@@ -209,14 +209,14 @@ def update_interface(backend_choice):
'mem_fraction_static'
,
'mem_fraction_static'
,
type
=
float
,
type
=
float
,
help
=
"Set the static memory fraction for SgLang engine. "
,
help
=
"Set the static memory fraction for SgLang engine. "
,
default
=
None
,
# 改为默认值为None
default
=
None
,
)
)
@
click
.
option
(
@
click
.
option
(
'--enable-torch-compile'
,
'--enable-torch-compile'
,
'torch_compile_enable'
,
'torch_compile_enable'
,
type
=
bool
,
type
=
bool
,
help
=
"Enable torch compile for SgLang engine. "
,
help
=
"Enable torch compile for SgLang engine. "
,
default
=
Tru
e
,
default
=
Fals
e
,
)
)
@
click
.
option
(
@
click
.
option
(
'--enable-api'
,
'--enable-api'
,
...
@@ -232,7 +232,6 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
...
@@ -232,7 +232,6 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
from
mineru.backend.vlm.vlm_analyze
import
ModelSingleton
from
mineru.backend.vlm.vlm_analyze
import
ModelSingleton
modelsingleton
=
ModelSingleton
()
modelsingleton
=
ModelSingleton
()
# 构建参数字典
model_params
=
{
model_params
=
{
"enable_torch_compile"
:
torch_compile_enable
"enable_torch_compile"
:
torch_compile_enable
}
}
...
@@ -244,7 +243,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
...
@@ -244,7 +243,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
"sglang-engine"
,
"sglang-engine"
,
None
,
None
,
None
,
None
,
**
model_params
# 使用解包运算符传递参数
**
model_params
)
)
print
(
"SgLang engine init successfully."
)
print
(
"SgLang engine init successfully."
)
except
Exception
as
e
:
except
Exception
as
e
:
...
...
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