diff --git a/config/model/model.json b/config/model/model.json index c836f1fe..dcf425da 100644 --- a/config/model/model.json +++ b/config/model/model.json @@ -181,13 +181,13 @@ "const": "NVIDIA_TESLA_T4", "instillShortDescription": "Deploy model that runs on Nvidia T4 GPU", "description": "Deploy model that runs on Nvidia T4 GPU", - "title": "Nvidia Tesla T4" + "title": "NVIDIA Tesla T4" }, { "const": "NVIDIA_L4", "instillShortDescription": "Deploy model that runs on Nvidia L4 GPU", "description": "Deploy model that runs on Nvidia L4 GPU", - "title": "Nvidia L4" + "title": "NVIDIA L4" }, { "const": "NVIDIA_A100", diff --git a/go.mod b/go.mod index 17dcb709..4812145a 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.21.0 github.com/iancoleman/strcase v0.3.0 github.com/influxdata/influxdb-client-go/v2 v2.14.0 - github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241129105617-c2c298e76498 + github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241211175103-4f1558f81c9c github.com/instill-ai/usage-client v0.3.0-alpha github.com/instill-ai/x v0.5.0-alpha.0.20241203111314-11f1aa4a3d91 github.com/jackc/pgx/v5 v5.6.0 diff --git a/go.sum b/go.sum index 42f25dcd..3d1610cb 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.14.0 h1:AjbBfJuq+QoaXNcrova8smSjw github.com/influxdata/influxdb-client-go/v2 v2.14.0/go.mod h1:Ahpm3QXKMJslpXl3IftVLVezreAUtBOTZssDrjZEFHI= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241129105617-c2c298e76498 h1:JYRfk/m+960jEScE1NPQM+xh+ScR4cHNMg/tCFwQbpI= -github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241129105617-c2c298e76498/go.mod h1:rf0UY7VpEgpaLudYEcjx5rnbuwlBaaLyD4FQmWLtgAY= +github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241211175103-4f1558f81c9c h1:Ms49DzMSgT/g9k6xFeaY274O9S53sLMhdYZn/ld2UtU= +github.com/instill-ai/protogen-go v0.3.3-alpha.0.20241211175103-4f1558f81c9c/go.mod h1:rf0UY7VpEgpaLudYEcjx5rnbuwlBaaLyD4FQmWLtgAY= github.com/instill-ai/usage-client v0.3.0-alpha h1:yY5eNn5zINqy8wpOogiNmrVYzJKnd1KMnMxlYBpr7Tk= github.com/instill-ai/usage-client v0.3.0-alpha/go.mod h1:8lvtZulkhQ7t8alttb2KkLKYoCp5u4oatzDbfFlEld0= github.com/instill-ai/x v0.5.0-alpha.0.20241203111314-11f1aa4a3d91 h1:baD7UhjwpmbBkaykoxi+6qd9A97qb/fkvvkocmwSrFA= diff --git a/pkg/handler/public.go b/pkg/handler/public.go index 200efaee..e24194e2 100644 --- a/pkg/handler/public.go +++ b/pkg/handler/public.go @@ -1065,18 +1065,27 @@ func (h *PublicHandler) ListAvailableRegions(ctx context.Context, req *modelpb.L for _, r := range regionsStruct { subRegion := &modelpb.Region{ RegionName: r.Const, - Hardware: []string{}, + Hardware: []*modelpb.Hardware{}, } for _, h := range hardwaresStruct { if h.If.Properties.Region.Const == r.Const { for _, hardware := range h.Then.Properties.Hardware.OneOf { - subRegion.Hardware = append(subRegion.Hardware, hardware.Const) + subRegion.Hardware = append(subRegion.Hardware, &modelpb.Hardware{ + Title: hardware.Title, + Value: hardware.Const, + }) } for _, hardware := range h.Then.Properties.Hardware.AnyOf { if hardware.Const != "" { - subRegion.Hardware = append(subRegion.Hardware, hardware.Const) + subRegion.Hardware = append(subRegion.Hardware, &modelpb.Hardware{ + Title: hardware.Title, + Value: hardware.Const, + }) } else if hardware.Title != "" { - subRegion.Hardware = append(subRegion.Hardware, hardware.Title) + subRegion.Hardware = append(subRegion.Hardware, &modelpb.Hardware{ + Title: hardware.Title, + Value: "", + }) } } }