Class SourceModel (1.118.0)

SourceModel(base_model: str, custom_base_model: str = "")

A model that is used in managed OSS supervised tuning.

Usage:

model = SourceModel(
    base_model="meta/llama3.1-8b", # OSS model name <publisher>/<model_name>
    custom_base_model="gs://user-bucket/custom-weights",
)
sft_tuning_job = sft.train(
    source_model=model,
    train_dataset="gs://my-bucket/train.jsonl",
    validation_dataset="gs://my-bucket/validation.jsonl",
    epochs=4,
    tuned_model_display_name="my-tuned-model",
    output_uri="gs://user-bucket/tuned-model"
)

while not sft_tuning_job.has_ended:
    time.sleep(60)
    sft_tuning_job.refresh()

tuned_model = aiplatform.Model(sft_tuning_job.tuned_model_name)
```

Methods

SourceModel

SourceModel(base_model: str, custom_base_model: str = "")

Initializes SourceModel.