Browse Source

show models

tags/v1.22.11.1^2
lewis 3 years ago
parent
commit
7c2ba62918
2 changed files with 0 additions and 6 deletions
  1. +0
    -3
      modules/storage/obs.go
  2. +0
    -3
      routers/api/v1/repo/modelarts.go

+ 0
- 3
modules/storage/obs.go View File

@@ -421,7 +421,6 @@ func GetOneLevelAllObjectUnderDir(bucket string, prefixRootPath string, relative
input := &obs.ListObjectsInput{}
input.Bucket = bucket
input.Prefix = prefixRootPath + relativePath
log.Info(input.Prefix)
if !strings.HasSuffix(input.Prefix, "/") {
input.Prefix += "/"
}
@@ -435,14 +434,12 @@ func GetOneLevelAllObjectUnderDir(bucket string, prefixRootPath string, relative
log.Info("Page:%d\n", index)
index++
for _, val := range output.Contents {
log.Info("val key=" + val.Key)
var isDir bool
var fileName string
if val.Key == input.Prefix {
continue
}
fileName = val.Key[prefixLen:]
//log.Info("fileName =" + fileName)
files := strings.Split(fileName, "/")
if fileMap[files[0]] {
continue


+ 0
- 3
routers/api/v1/repo/modelarts.go View File

@@ -470,13 +470,10 @@ func ModelList(ctx *context.APIContext) {
status := models.StorageScheduleSucceed
var fileInfos []storage.FileInfo
if task.ComputeResource == models.NPUResource {
//fileInfos, err = storage.GetObsListObject(task.JobName, "output/", parentDir, versionName)
prefix := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, task.JobName, setting.OutPutPath, versionName), "/")
log.Info(prefix)
if !strings.HasSuffix(prefix, "/") {
prefix += "/"
}
log.Info(prefix)
fileInfos, err = storage.GetOneLevelAllObjectUnderDir(setting.Bucket, prefix, parentDir)
if err != nil {
log.Info("get TrainJobListModel failed:", err)


Loading…
Cancel
Save