Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add-vertex-ai-model-COPY' into v…
Browse files Browse the repository at this point in the history
…ertex-ai-model-UPLOAD
  • Loading branch information
BBBmau committed Oct 23, 2024
2 parents 83849bc + 2900c02 commit b6c68f0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mmv1/products/vertexai/Models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ async:
result:
path: 'response'
resource_inside_response: true
status:
path: 'done'
complete: true
allowed:
- true
- false
error:
path: 'error'
message: 'message'
Expand Down
16 changes: 16 additions & 0 deletions mmv1/templates/terraform/encoders/vertex_ai_models.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,20 @@ if obj["sourceModel"] != nil {
delete(obj, "metadata")
}

newObj := make(map[string]interface{})
name := ""
if v, ok := d.GetOk("model_id"); ok {
name = v.(string)
delete(obj,"modelId")
} else {
name = d.Get("name").(string)
}
newObj["modelId"] = name
if v, ok := d.GetOk("parent_model"); ok {
newObj["parentModel"] = v
delete(obj,"parentModel")
}
newObj["model"] = obj
return newObj, nil

return obj, nil

0 comments on commit b6c68f0

Please sign in to comment.