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
255b4e83
"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "4ecc1c06d3ae3f79d1daac556e6743d09787db75"
Commit
255b4e83
authored
Nov 13, 2024
by
zhougaofeng
Browse files
Update ofd_parse.py
parent
3cfc9159
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
magic_pdf/parse/ofd_parse.py
magic_pdf/parse/ofd_parse.py
+4
-3
No files found.
magic_pdf/parse/ofd_parse.py
View file @
255b4e83
...
...
@@ -104,13 +104,13 @@ class ocrOfdClient:
try
:
response
=
requests
.
get
(
health_check_url
)
if
response
.
status_code
==
200
:
logger
.
info
(
"Server is healthy and ready to process requests."
)
logger
.
info
(
"
ofd
Server is healthy and ready to process requests."
)
return
True
else
:
logger
.
error
(
f
'Server health check failed with status code:
{
response
.
status_code
}
'
)
logger
.
error
(
f
'
ofd
Server health check failed with status code:
{
response
.
status_code
}
'
)
return
False
except
requests
.
exceptions
.
RequestException
as
e
:
logger
.
error
(
f
'Health check request failed:
{
e
}
'
)
logger
.
error
(
f
'
ofd
Health check request failed:
{
e
}
'
)
return
False
def
parse_ofd
(
self
,
config_path
,
file_path
,
output_dir
):
...
...
@@ -121,6 +121,7 @@ class ocrOfdClient:
"config_path"
:
str
(
config_path
),
}
# 发送 POST 请求
logger
.
info
(
f
'data:
{
data
}
'
)
response
=
requests
.
post
(
f
"
{
self
.
api_url
}
/ofd_ocr"
,
json
=
data
)
# 处理响应
...
...
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