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

Change Endpoint of VertexAI SFT Job

Hello,

A while ago, I created a Supervised Fine-Tuning Job on VertexAI, using this guide: https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning. However, my endpoint got deleted from someone on the support team (we were working on fixing a different issue). Since it got deleted, I get an error saying that the endpoint can't be found (makes sense, since it got deleted). So, I created a new endpoint, and deployed my previously fine-tuned model there. However, when I try to use the model through Python, I get the same error, saying that the endpoint can't be found. Here is the code I am using:

import vertexai
from vertexai.tuning import sft

# Setup fine-tuned model
PROJECT_ID = config["PROJECT_ID"]
TUNING_JOB_REGION = config["TUNING_JOB_REGION"]
TUNING_JOB_ID = config["TUNING_JOB_ID"]

vertexai.init(project=PROJECT_ID, location="us-central1")
sft_tuning_job = sft.SupervisedTuningJob(f"projects/{PROJECT_ID}/locations/{TUNING_JOB_REGION}/tuningJobs/{TUNING_JOB_ID}")
model = GenerativeModel(sft_tuning_job.tuned_model_endpoint_name, generation_config=GenerationConfig(temperature=temperature))

My questions are:

1) Is the SFT job always connected with a single endpoint? And when that endpoint is deleted, does that mean that you have to fine-tune the model again?

2) Is there a way to use the fine-tuned model which is deployed to the new endpoint, without using the vertexai.tuning.sft library?

3) If not, is there a way to change the vertexai.tuning.sft endpoint?

Any assistance is greatly appreciated!

0 REPLIES 0