New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: intro_multimodal_rag: Vertex AI API Call Results in _MultiThreadedRendezvous/InvalidArgument Error #427
Comments
Added Python version details. |
Updated environment details for VertexAI Workbench. |
Hi @ab-kotecha, Thank you for raising the issue. As a quick fix, can you please enable “add_sleep_after_page" as True and then re-run this block:
If you can also share few more details about your workflow, it would really help me zero down the issues and I can help and support you better:
|
Thanks for your suggestion Lavi. I have kept the settings for add_sleep_after_page and sleep_time_after_page by uncommenting them earlier for both Vertex AI Workbench and Google Colab platform. With and without those settings active for all. How many documents are you passing and how many pages does that have overall? Processing page: 1 Strangely enough, I did the same thing in the Skill Boost environment lab, that issue was not there. Then I copied the notebook content from lab and pasted the file in my personal account, the issue appeared again. I was able to reproduce the same error on Vertex AI Workbench and Google Colab, with or without the add_sleep_after_page and sleep_time_after_page configs. |
I tried again, the following is the cell output for the code below: # Specify the PDF folder with multiple PDF
# pdf_folder_path = "/content/data/" # if running in Google Colab/Colab Enterprise
pdf_folder_path = "data/" # if running in Vertex AI Workbench.
# Specify the image description prompt. Change it
image_description_prompt = """Explain what is going on in the image.
If it's a table, extract all elements of the table.
If it's a graph, explain the findings in the graph.
Do not include any numbers that are not mentioned in the image.
"""
# Extract text and image metadata from the PDF document
text_metadata_df, image_metadata_df = get_document_metadata(
multimodal_model, # we are passing gemini 1.0 pro vision model
pdf_folder_path,
image_save_dir="images",
image_description_prompt=image_description_prompt,
embedding_size=1408,
add_sleep_after_page = True, # Uncomment this if you are running into API quota issues
sleep_time_after_page = 5,
# generation_config = # see next cell
# safety_settings = # see next cell
)
print("\n\n --- Completed processing. ---")
|
I tried this again today in different environments. I am getting the same issue. Not sure if I need to perform any operation to the GCloud API/Limits? |
HI @ab-kotecha, It seems like a localized issue at your end, possibly something to do with your Access or Quota. I tested the notebook again with my personal GCP account and the notebook seems to be working fine. Are you using personal GCP account (and on free $300 credits) or corporate account? |
Hi Lavi,
Thanks for your email. I tested this on a corporate account.
Which quote/limit do you think I should use? I checked all the quota on the
Service Limits, and none of them are being hit. I am not sure if there is
any additional API that I need to enable?
Best,
Abhishek
…On Fri, 8 Mar 2024 at 11:21, Lavi Nigam ***@***.***> wrote:
HI @ab-kotecha <https://github.com/ab-kotecha>, It seems like a localized
issue at your end, possibly something to do with your Access or Quota. I
tested the notebook again with my personal GCP account and the notebook
seems to be working fine. Are you using personal GCP account (and on free
$300 credits) or corporate account?
—
Reply to this email directly, view it on GitHub
<#427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APQIJDKXEJWTJJMO4TRX6QDYXFGVLAVCNFSM6AAAAABD5LX2HKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVGA3TSNBRGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Contact Details
abhishek@datavtar.com
File Name
gemini/getting-started/intro_gemini_python.ipynb
What happened?
Summary
Encounter an
InvalidArgument
error when executing a content generation request using Vertex AI's API in a custom processing workflow for PDF documents. The error occurs within theget_gemini_response
function, disrupting the extraction and processing of image and text metadata.Steps to Reproduce
get_document_metadata
function with a valid PDF document, specifying parameters for image description generation.InvalidArgument
error during the execution ofget_gemini_response
, specifically when callinggenerative_multimodal_model.generate_content
.Expected Behavior
The expected behavior is successful generation of content descriptions for images extracted from PDF documents without encountering an
InvalidArgument
error.Actual Behavior
The process fails, triggering an
_MultiThreadedRendezvous
that leads to anInvalidArgument
error. The traceback indicates an issue with the content generation request to Vertex AI's API.Environment
Additional Context
Possible Causes and Solutions
generate_content
API call.Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: