I’m using a pipeline job to fine tune a text-bison model with Vertex AI on GCP. My API is logged using a dedicated service account. It has the roles : Vertex AI Service Agent and Service Accounts User.
I’m using this Node.js code :
import aiplatform from '@google-cloud/aiplatform';
class ModelTuningController {
initiateModelTuning = catchAsync(async (req, res) => {
const { modelDisplayName = 'fineTunedTest' } = req.body;
const { PipelineServiceClient } = aiplatform.v1;
const location = 'us-central1';
const project = 'projectID';
const model = 'text-bison@001';
const pipelineClient = new PipelineServiceClient({
apiEndpoint: `${location}-aiplatform.googleapis.com`,
keyFilename: config.vector_store_key_filename,
});
const parameters = {
source_model: { stringValue: model },
train_dataset: {
stringValue: 'gs://path/file.jsonl',
},
tuned_model_display_name: {
stringValue: modelDisplayName,
},
epochs: {
numberValue: 4,
},
learning_rate_multiplier: {
numberValue: 1,
},
};
const runtimeConfig = {
gcsOutputDirectory: 'gs://output-path',
parameterValues: parameters,
};
try {
const parent = `projects/${project}/locations/${location}`;
const pipelineJob = {
displayName: modelDisplayName,
runtimeConfig,
};
const request = {
parent,
pipelineJob,
};
const [response] = await pipelineClient.createPipelineJob(request);
return sendResponse(res, {
message: ModelTuningMessages.jobInitiated(response.name),
});
} catch (err) {
return sendError(
err,
new ApiError(
httpStatus.INTERNAL_SERVER_ERROR,
ModelTuningMessages.jobError
)
);
}
});
}
export default ModelTuningController;
I have the following error : You do not have permission to act as service_account: ${projectID}[email protected]. (or it may not exist).
The problem is ${projectID}[email protected] is the project default service account. My guess it that my service account should act as the default service account of the project.
Does my service account is missing a role to execute the fine tuning job on Vertex AI ?