vertex AI - trained model with AutoML

I have trained a model and I'm able to fetch predictions from the endpoint. However, when I try to use the model in the following code:

pythonCopy code
model = TextGenerationModel.from_pretrained("*********")

I'm getting an error that says:

"NotFound: 404 Publisher Model publishers/google/models/******** is not found."

Could you please tell me how I can use my trained model in this code?

Is there any additional context or information you can provide to help with this issue?

 

 

vertexai.preview.language_models import TextGenerationModel


def write_a_function(temperature: float = 0.5) -> object:
"""Example of using Code Chat Model to write a function."""

parameters = {
"temperature": temperature, # Temperature controls the degree of randomness in token selection.
"max_output_tokens": 1024, # Token limit determines the maximum amount of text output.
}
model = TextGenerationModel.from_pretrained("*********")

response = model.predict(
'Give me all resource list',
**parameters,
)
print(f"Response from Model: {response }")
0 2 576
2 REPLIES 2

Are you following any documentation for this task? One of the common causes of this issue is region mismatch(Calling the model from that is on a different region), I would suggest filling a support case for this to take them a better look at your logs and resources. 

Hi Reshubisen , I had the same problem and I resolved it by changing the region. For example:

ilovebots_0-1713467270836.png

When I changed to another region like "us-central1," it worked.

ilovebots_1-1713467365703.png