Issue
Using Vertex AI, I am trying to prompt an endpoint connected to a finetuned GPT-2 model (pytorch) via Git Bash. While importing the model, I did not set up any predict schemata. I believe the model should accept tensors.
Here is my code:
$ curl \
-X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/us-central1/endpoints/${ENDPOINT_ID}:predict \
-d "@${INPUT_DATA_FILE}"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 230 0 93 100 137 387 570 --:--:-- --:--:-- --:--:-- 970{
"code": 404,
"type": "ModelNotFoundException",
"message": "Model not found: model"
}
I know I'm not using the Google Cloud SDK Shell as is recommended, but I got a "ACCESS_TOKEN_TYPE_UNSUPPORTED" error while trying to use that. I will try it again, but I suspect I will get the same error as through Git Bash. Does the message Model not found: model
mean that I somehow deployed the endpoint incorrectly? Or perhaps something broke while importing the model into the model registry? Any tips would be appreciated.
Solution
The error message "Model not found: model" typically indicates that the model you are trying to use in your Vertex AI endpoint is not found.
Make sure that you are using the correct model name in your API request. The PROJECT_ID
and ENDPOINT_ID
should be set correctly, and the model name should match the name of the model you deployed. It's also possible that there was an issue during the deployment of your fine-tuned GPT-2 model to Vertex AI. You should ensure that the model is successfully deployed and is available in the model registry.
You mentioned that you are using Git Bash and encountered and "ACCESS_TOKEN_TYPE_UNSUPPORTED" error while using the Google Cloud SDK Shell. Ensure that you have the necessary permissions to access the model and the endpoint. Make sure you are using the correct credentials and access token. Also, verify that the PROJECT_ID and the us-central1 location match the project and location where you deployed the model. Ensure that the endpoint you are trying to access is in the "serving" state. If the endpoint is not deployed or is in an error state, you may encounter this error. If you have multiple versions of the same model deployed, make sure you specify the correct model version in your request.
To resolve this issue, you should check the above points and make sure that your model and endpoint are set up correctly in Vertex AI. If you continue to face issues, you may want to explore the error message further by checking the logs in the Google Cloud Console or using the Google Cloud SDK Shell for more detailed error information.
Answered By - Poala Astrid Answer Checked By - Clifford M. (WPSolving Volunteer)