Class SourceModel (1.121.0)
Stay organized with collections
Save and categorize content based on your preferences.
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 = "")
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-15 UTC."],[],[]]