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
a5a680b7
Commit
a5a680b7
authored
Jul 05, 2025
by
myhloli
Browse files
refactor: use dynamic suffix lists for file type checks in fast_api.py
parent
802ccd93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mineru/cli/fast_api.py
mineru/cli/fast_api.py
+2
-2
No files found.
mineru/cli/fast_api.py
View file @
a5a680b7
...
...
@@ -11,7 +11,7 @@ from typing import List, Optional
from
loguru
import
logger
from
base64
import
b64encode
from
mineru.cli.common
import
aio_do_parse
,
read_fn
from
mineru.cli.common
import
aio_do_parse
,
read_fn
,
pdf_suffixes
,
image_suffixes
from
mineru.utils.cli_parser
import
arg_parse
from
mineru.version
import
__version__
...
...
@@ -69,7 +69,7 @@ async def parse_pdf(
file_path
=
Path
(
file
.
filename
)
# 如果是图像文件或PDF,使用read_fn处理
if
file_path
.
suffix
.
lower
()
in
[
".pdf"
,
".png"
,
".jpeg"
,
".jpg"
]
:
if
file_path
.
suffix
.
lower
()
in
pdf_suffixes
+
image_suffixes
:
# 创建临时文件以便使用read_fn
temp_path
=
Path
(
unique_dir
)
/
file_path
.
name
with
open
(
temp_path
,
"wb"
)
as
f
:
...
...
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