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 }")

