Skip to content

Commit

Permalink
rename_docprompt_pipeline (PaddlePaddle#3731)
Browse files Browse the repository at this point in the history
  • Loading branch information
lugimzzz authored Nov 14, 2022
1 parent 70c8bfc commit b63f356
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def docprompt_pipeline():

preprocessor = DocOCRProcessor(use_gpu=use_gpu)
docprompter = DocPrompter(use_gpu=use_gpu, batch_size=args.batch_size)
pipe = DocPipeline(preprocessor=preprocessor, modelrunner=docprompter)
pipe = DocPipeline(preprocessor=preprocessor, docreader=docprompter)
# image link input
meta = {
"doc":
Expand Down
8 changes: 4 additions & 4 deletions pipelines/pipelines/pipelines/standard_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,17 @@ class DocPipeline(BaseStandardPipeline):
Pipeline for document intelligence.
"""

def __init__(self, preprocessor: BaseComponent, modelrunner: BaseComponent):
def __init__(self, preprocessor: BaseComponent, docreader: BaseComponent):
"""
:param preprocessor: file/image preprocessor instance
:param modelrunner: document model runner instance
:param docreader: document model runner instance
"""
self.pipeline = Pipeline()
self.pipeline.add_node(component=preprocessor,
name="PreProcessor",
inputs=["Query"])
self.pipeline.add_node(component=modelrunner,
name="Runner",
self.pipeline.add_node(component=docreader,
name="Reader",
inputs=["PreProcessor"])

def run(self,
Expand Down
4 changes: 2 additions & 2 deletions pipelines/rest_api/pipeline/docprompt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ components:
use_gpu: True
lang: ch
type: DocOCRProcessor
- name: Runner
- name: Reader
params:
topn: 1
use_gpu: True
Expand All @@ -23,7 +23,7 @@ pipelines:
nodes:
- name: PreProcessor
inputs: [Query]
- name: Runner
- name: Reader
inputs: [PreProcessor]


0 comments on commit b63f356

Please sign in to comment.