|
|
|
@@ -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 { |
|
|
|
|