I'm trying to build a chatbot using Google's Generative AI and Vertex AI. My script works well up until I try to ask a question. Each time I do that, this error pops up:
PermissionDenied: 403 Permission 'aiplatform.endpoints.predict' denied on resource '//aiplatform.googleapis.com/projects/study-guide-chatbot/locations/us-central1/publishers/google/models/gemini-1.5-pro' (or it may not exist). [reason: "IAM_PERMISSION_DENIED" domain: "aiplatform.googleapis.com" metadata { key: "resource" value: "projects/study-guide-chatbot/locations/us-central1/publishers/google/models/gemini-1.5-pro" } metadata { key: "permission" value: "aiplatform.endpoints.predict" } ].
The app is based on a python script and it run well until my free trial of Google's services run out and I had to make a new project on another account to keep working on my project.
I've already tried resetting the app through Google SDK, running the gcloud auth commands and checked all of my user's Permissions in IAM. I just can't figure out what to do to solve this issue.
My user is set to owner and this is how I set up the model in my code:
model = VertexAI(model="gemini-1.5-pro",
client=genai,
temperature=0.25,
)
prompt = PromptTemplate(template=prompt_template,
input_variables=["context", "question"])
chain = load_qa_chain(llm=model, chain_type="stuff", prompt=prompt)
Thanks in advance.
It seems that you do not have the aiplatform.endpoints.predict permission. You can add the Vertex AI User role in the project iam.
For a complete list of Vertex AI IAM permissions, please see this link
Vertex AI access control with IAM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With