Skip to content

Commit

Permalink
Update worker.py
Browse files Browse the repository at this point in the history
Only store prediction as ocr data
  • Loading branch information
DrRSatzteil authored Jan 6, 2024
1 parent 49456ca commit 1fc2b74
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mayanmindee/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ def process_standard(document_id: int, document_type: str) -> None:
if "storeocr" in apis[document_type]:
storeocr = apis[document_type]["storeocr"]
if storeocr:
prediction = json.dumps(
parsed_doc.http_response["document"]["inference"]["prediction"]
)
prediction = json.dumps(json.loads(parsed_doc.raw_http)["document"]["inference"]["prediction"])
add_metadata(
m,
document,
Expand Down Expand Up @@ -259,7 +257,7 @@ def process_custom(document_id: int, document_type: str, synchronous: False) ->
if "storeocr" in apis[document_type]:
storeocr = apis[document_type]["storeocr"]
if storeocr:
prediction = parsed_doc.raw_http["document"]["inference"]["prediction"]
prediction = json.dumps(json.loads(parsed_doc.raw_http)["document"]["inference"]["prediction"])
add_metadata(
m,
document,
Expand Down

0 comments on commit 1fc2b74

Please sign in to comment.