You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
I am trying to run the OOTB code shared for batch processing of the invoices. Here is the sample call that invokes the code: batch_process_documents(project_id='', location='us', processor_id='', gcs_input_uri='gs:///Invoice.pdf', gcs_output_uri='gs://*', gcs_output_uri_prefix='inv')
Run the boiler plate code.
Code example
# example
Stack trace
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-30-42be8c6d0dd8> in <module>
----> 1 batch_process_documents(project_id='***', location='us', processor_id='***', gcs_input_uri='gs://***/Invoice.pdf', gcs_output_uri='gs://***', gcs_output_uri_prefix='inv')
<ipython-input-28-f0fe586dfadb> in batch_process_documents(project_id, location, processor_id, gcs_input_uri, gcs_output_uri, gcs_output_uri_prefix)
66 for i, blob in enumerate(blob_list):
67 # Download the contents of this blob as a bytes object.
---> 68 blob_as_bytes = blob.download_as_bytes()
69 document = documentai.types.Document.from_json(blob_as_bytes)
70
AttributeError: 'Blob' object has no attribute 'download_as_bytes'
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
If you are still having issues, please be sure to include as much information as possible:
Environment details
python --version: Python 3.7pip --version: pip 20.1.1 from /opt/conda/lib/python3.7/site-packages/pip (python 3.7)google-cloud-documentaiversion:pip show google-cloud-documentai: jupyter@python-20200630-170900:~$ pip show google-cloud-documentaiName: google-cloud-documentai
Version: 0.3.0
Summary: UNKNOWN
Home-page: https://github.com/googleapis/python-documentai
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: /opt/conda/lib/python3.7/site-packages
Requires: google-api-core, proto-plus
Required-by:
Steps to reproduce
Code example
# exampleStack trace
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!