Search code examples
pythongoogle-colaboratorygoogle-cloud-vertex-aigoogle-gemini

400 Bison model tuning is deprecated. Please migrate to Gemini tuning


I've been struggling with this error a day now. I'm trying to run Kubeflow pipeline for model fine tuning using VertexAI on colab. This is the code that I'm using

# Get the current date for model naming
date = datetime.datetime.now().strftime("%Y-%m-%d")
MODEL_NAME = f"qa-model-{date}"

# Pipeline arguments
pipeline_arguments = {
    "model_display_name": MODEL_NAME,
    "location": REGION,
    "project": PROJECT_ID,
    "large_model_reference": "gemini-1.0-pro-002",  # Model reference for question answering
    "train_steps": TRAINING_STEPS,
    "dataset_uri": TRAINING_DATA_URI,
    "evaluation_interval": EVALUATION_INTERVAL,
    "evaluation_data_uri": EVALUATION_DATA_URI,
}

# Define the pipeline template path for model tuning
template_path = "https://us-kfp.pkg.dev/ml-pipeline/large-language-model-pipelines/tune-large-model/v2.0.0"

# Create a pipeline job for fine-tuning the model
job = aiplatform.PipelineJob(
    template_path=template_path,
    display_name="fine-tune-gemini-qa",
    parameter_values=pipeline_arguments,
    location=REGION,
    pipeline_root="gs://zeinab-llmops-vertexai/pipeline_root",  # GCS path for storing pipeline artifacts
    enable_caching=True
)

# Submit the pipeline job
job.submit()

Obviously I'm trying to use Gemini, but I get the following error which complains about using Bison and suggests me to use Gemini!!

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.FAILED_PRECONDITION
    details = "Bison model tuning is deprecated. Please migrate to Gemini tuning."
    debug_error_string = "UNKNOWN:Error received from peer ipv4:172.217.203.95:443 {created_time:"2025-02-28T06:30:14.731451386+00:00", grpc_status:9, grpc_message:"Bison model tuning is deprecated. Please migrate to Gemini tuning."}"
>

The above exception was the direct cause of the following exception:

FailedPrecondition                        Traceback (most recent call last)
/usr/local/lib/python3.11/dist-packages/google/api_core/grpc_helpers.py in error_remapped_callable(*args, **kwargs)
     76             return callable_(*args, **kwargs)
     77         except grpc.RpcError as exc:
---> 78             raise exceptions.from_grpc_error(exc) from exc
     79 
     80     return error_remapped_callable

FailedPrecondition: 400 Bison model tuning is deprecated. Please migrate to Gemini tuning.

I have a paid GCP account with enough credit, and I have Vertex AI user role on the project. I would appreciate any help!


Solution

  • You can find how to tune Gemini here: https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning

    The SDK syntax you are using is indeed from deprecated bison