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
7c8fb44b
Commit
7c8fb44b
authored
Jun 06, 2025
by
myhloli
Browse files
refactor: enhance device mode detection to support CUDA and MPS
parent
f407079b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
mineru/backend/pipeline/config_reader.py
mineru/backend/pipeline/config_reader.py
+6
-2
No files found.
mineru/backend/pipeline/config_reader.py
View file @
7c8fb44b
...
...
@@ -2,6 +2,7 @@
import
json
import
os
import
torch
from
loguru
import
logger
# 定义配置文件名常量
...
...
@@ -93,8 +94,11 @@ def get_device():
if
device_mode
is
not
None
:
return
device_mode
else
:
logger
.
warning
(
f
"not found 'MINERU_DEVICE_MODE' in environment variable, use 'cpu' as default."
)
return
'cpu'
if
torch
.
cuda
.
is_available
():
return
"cuda"
if
torch
.
backends
.
mps
.
is_available
():
return
"mps"
return
"cpu"
def
get_table_recog_config
():
...
...
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