Being new to GenerativeAI world, I am trying to load a pre-trained text generation model and doing some stuff which is not working. This is how I load the GenerativeAI model.
from vertexai.generative_models import GenerativeModel
generation_model = GenerativeModel("gemini-pro")
Since it does not work, I feel I might have to use some other GenerativeAI model, not “gemini-pro”. Even I try following piece of code to check all the models supported by Gemini.
import google.generativeai as genai
for model in genai.list_models():
if 'generateContent' in model.supported_generation_methods:
print(model.name)
But I get ‘PermissionDenied‘ error as attached image shows.
Now as a programmer I have 2 queries here.
Q1. Can I see the GenerativeAI models supported by Gemini or not?
Q2. If answer is ‘Yes’, what is the Python code?