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
eaf009d8
Commit
eaf009d8
authored
Nov 22, 2024
by
zhougaofeng
Browse files
Update pdf_server.py
parent
2830978d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
magic_pdf/tools/pdf_server.py
magic_pdf/tools/pdf_server.py
+6
-2
No files found.
magic_pdf/tools/pdf_server.py
View file @
eaf009d8
...
...
@@ -16,8 +16,7 @@ from pydantic import BaseModel
import
uvicorn
import
time
import
configparser
from
magic_pdf.dict2md.ocr_vllm_client
import
PredictClient
,
compress_image
# from magic_pdf.dict2md.ocr_client import PredictClient,compress_image
from
magic_pdf.parse.ofd_parse
import
*
from
magic_pdf.tools.ofd_parser
import
OFDParser
from
magic_pdf.parse.pdf_client
import
ocrPdfClient
...
...
@@ -82,6 +81,11 @@ def ocr_pdf_serve(args: str):
config
.
read
(
args
.
config_path
)
# host = config.get('server', 'pdf_host')
# port = int(config.get('server', 'pdf_port'))
vllm_able
=
config
.
get
(
'vllm'
,
'vllm_able'
)
if
vllm_able
:
from
magic_pdf.dict2md.ocr_vllm_client
import
PredictClient
,
compress_image
else
:
from
magic_pdf.dict2md.ocr_client
import
PredictClient
,
compress_image
pdf_server
=
config
.
get
(
'server'
,
'pdf_server'
).
split
(
'://'
)[
1
]
host
,
port
=
pdf_server
.
split
(
':'
)[
0
],
int
(
pdf_server
.
split
(
':'
)[
1
])
global
config_path
...
...
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