Merge branch 'master' of https://gitlink.org.cn/JointCloud/pcm-coordinator
This commit is contained in:
commit
185f548b36
|
@ -2,7 +2,7 @@ name: Sync Mirror Repository
|
|||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *' # 每小时同步一次
|
||||
- cron: '0 */8 * * *' # 每小时同步一次
|
||||
workflow_dispatch: # 允许手动触发
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -812,10 +812,37 @@ func (m *ModelArtsLink) CheckModelExistence(ctx context.Context, name string, mt
|
|||
ModelName: name,
|
||||
ModelType: mtype,
|
||||
}
|
||||
err := m.GetModelId(ctx, ifoption)
|
||||
err := m.CheckImageExist(ctx, ifoption)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (m *ModelArtsLink) CheckImageExist(ctx context.Context, option *option.InferOption) error {
|
||||
req := &modelarts.ListImagesReq{
|
||||
Limit: m.pageSize,
|
||||
Offset: m.pageIndex,
|
||||
}
|
||||
ListImageResp, err := m.modelArtsRpc.ListImages(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var modelName string
|
||||
if ListImageResp.Code == 200 {
|
||||
//return errors.New("failed to get ModelId")
|
||||
for _, ListImage := range ListImageResp.Data {
|
||||
if option.ModelName == "ChatGLM-6B" {
|
||||
modelName = "chatglm-6b"
|
||||
} else {
|
||||
modelName = option.ModelName
|
||||
}
|
||||
|
||||
if ListImage.Name == modelName {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return errors.New("failed to find Image ")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue