Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to make use of text-bison-32k model using python SDK

Hi folks,
I'm trying to make use of the text-bison-32k model using Python SDK. I have the appropriate credentials set using the credentials JSON and initialized vertex ai. I'm getting the following error -
ValueError: The model you are trying to instantiate does not support the launch stage: PUBLIC_PREVIEW
I'm able to make use of the model from the UI and command line though. Is there something that I'm missing out on?

Solved Solved
0 2 1,857
1 ACCEPTED SOLUTION

I ran into this today, and I was scratching my head for a bit.  Here is the solution.  Change your "import" to be preview.

 

from vertexai.preview.language_models import TextGenerationModel

 

View solution in original post

2 REPLIES 2

I ran into this today, and I was scratching my head for a bit.  Here is the solution.  Change your "import" to be preview.

 

from vertexai.preview.language_models import TextGenerationModel

 

Thanks, Todd. It worked. 
Weird though, since the code that Vertex provides in the console doesn't contain "preview" in "import".