diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 9311ddeac..9bab29250 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -1498,6 +1498,28 @@ func GetStarImages(ctx *context.Context) { } +func GetModelArtsImages(ctx *context.Context) { + var engines modelarts.Engine + _ = json.Unmarshal([]byte(setting.Engines), &engines) + ctx.Data["engines"] = engines.Info + + var versionInfos modelarts.VersionInfo + _ = json.Unmarshal([]byte(setting.EngineVersions), &versionInfos) + ctx.JSON(http.StatusOK, versionInfos.Version) + +} + +func GetC2netNpuImages(ctx *context.Context) { + images, err := grampus.GetImages(grampus.ProcessorTypeNPU) + if err != nil { + log.Error("GetImages failed:", err.Error()) + ctx.JSON(http.StatusOK, []models.GrampusImage{}) + } else { + ctx.JSON(http.StatusOK, images.Infos) + } + +} + func getUID(ctx *context.Context) int64 { var uid int64 = -1 if ctx.IsSigned { diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 66a357c79..c51f819a2 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -353,6 +353,8 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/images/public", repo.GetPublicImages) m.Get("/images/custom", repo.GetCustomImages) m.Get("/images/star", repo.GetStarImages) + m.Get("/images/modelarts", repo.GetModelArtsImages) + m.Get("/images/c2netnpu", repo.GetC2netNpuImages) m.Get("/repos", routers.ExploreRepos) m.Get("/datasets", routers.ExploreDatasets)