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
zhougaofeng
magic_pdf
Commits
c9d53e7a
Commit
c9d53e7a
authored
Nov 15, 2024
by
zhougaofeng
Browse files
Update ofd_parse.py
parent
4f28604a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
magic_pdf/parse/ofd_parse.py
magic_pdf/parse/ofd_parse.py
+2
-1
No files found.
magic_pdf/parse/ofd_parse.py
View file @
c9d53e7a
...
@@ -121,12 +121,13 @@ class ocrOfdClient:
...
@@ -121,12 +121,13 @@ class ocrOfdClient:
"config_path"
:
str
(
config_path
),
"config_path"
:
str
(
config_path
),
}
}
# 发送 POST 请求
# 发送 POST 请求
#logger.info(f'data:{data}')
response
=
requests
.
post
(
f
"
{
self
.
api_url
}
/ofd_ocr"
,
json
=
data
)
response
=
requests
.
post
(
f
"
{
self
.
api_url
}
/ofd_ocr"
,
json
=
data
)
# 处理响应
# 处理响应
if
response
.
status_code
==
200
:
if
response
.
status_code
==
200
:
result
=
response
.
json
()
result
=
response
.
json
()
logger
.
info
(
f
"文件解析成功,输出路径:
{
result
[
'output_path'
]
}
"
)
#
logger.info(f"文件解析成功,输出路径:{result['output_path']}")
return
result
[
'output_path'
]
return
result
[
'output_path'
]
else
:
else
:
logger
.
error
(
f
"文件解析失败,错误信息:
{
response
.
json
()
}
"
)
logger
.
error
(
f
"文件解析失败,错误信息:
{
response
.
json
()
}
"
)
...
...
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