generative-ai icon indicating copy to clipboard operation
generative-ai copied to clipboard

Quota exceeded no matter what the quota is in langchain notebook example

Open jeffbryner opened this issue 2 years ago • 4 comments

When attempting to run https://github.com/GoogleCloudPlatform/generative-ai/blob/main/language/use-cases/document-qa/question_answering_documents_langchain.ipynb in cell 18

doc_ids = me.add_texts(texts=texts, metadatas=metadatas)

I get a

ResourceExhausted: 429 Quota exceeded for aiplatform.googleapis.com/online_prediction_requests_per_base_model with base model: textembedding-gecko. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/quotas.

My quota is not exceeded however (and I increased it) when checking the quota dashboard in GCP.

I attempted to limit the scope using

doc_ids = me.add_texts(texts=texts[0], metadatas=metadatas[0])

and receive the same error.

jeffbryner avatar Aug 27 '23 19:08 jeffbryner

Screenshot 2023-08-27 at 12 35 08 PM

jeffbryner avatar Aug 27 '23 19:08 jeffbryner

This is just a quick hack so I could get the notebook to work:

def add_docs_to_index(start, end):
    doc_ids = me.add_texts(texts=texts[start:end], metadatas=metadatas[start:end])
    return end

loaded = 50
document_count = len(texts)
increment = 50

while loaded + increment <= document_count:
    start = loaded + 1
    end = start + increment
    indexed = add_docs_to_index(start, end)
    print('indexed = ', indexed)
    loaded += increment
    
remaining = document_count - loaded
add_docs_to_index(loaded +1, remaining)

GDBSD avatar Sep 12 '23 23:09 GDBSD

Was also getting a key error for document _name in the metadatas list of dicts. Looking at the metadata there was only source and chunk

GDBSD avatar Sep 12 '23 23:09 GDBSD

@inardini Can you take a look at this?

holtskinner avatar Feb 05 '24 18:02 holtskinner