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
08a9558f
Unverified
Commit
08a9558f
authored
Jan 21, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jan 21, 2025
Browse files
Merge pull request #1594 from myhloli/dev
perf(magic_pdf): adjust batch ratio calculation for GPU memory
parents
636d78a3
037736fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
magic_pdf/model/doc_analyze_by_custom_model.py
magic_pdf/model/doc_analyze_by_custom_model.py
+1
-1
No files found.
magic_pdf/model/doc_analyze_by_custom_model.py
View file @
08a9558f
...
...
@@ -177,7 +177,7 @@ def doc_analyze(
if
torch
.
cuda
.
is_available
()
and
device
!=
'cpu'
or
npu_support
:
gpu_memory
=
int
(
os
.
getenv
(
"VIRTUAL_VRAM_SIZE"
,
round
(
get_vram
(
device
))))
if
gpu_memory
is
not
None
and
gpu_memory
>=
8
:
batch_ratio
=
int
(
gpu_memory
-
5
)
batch_ratio
=
int
(
gpu_memory
-
6
)
if
batch_ratio
>=
1
:
logger
.
info
(
f
'gpu_memory:
{
gpu_memory
}
GB, batch_ratio:
{
batch_ratio
}
'
)
batch_model
=
BatchAnalyze
(
model
=
custom_model
,
batch_ratio
=
batch_ratio
)
...
...
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