|
|
|
@@ -86,8 +86,9 @@ type AiModelQueryOptions struct { |
|
|
|
SortType string |
|
|
|
New int |
|
|
|
// JobStatus CloudbrainStatus |
|
|
|
Type int |
|
|
|
Status int |
|
|
|
Type int |
|
|
|
Status int |
|
|
|
IsOnlyThisRepo bool |
|
|
|
} |
|
|
|
|
|
|
|
func (a *AiModelConvert) IsGpuTrainTask() bool { |
|
|
|
@@ -427,11 +428,11 @@ func QueryModel(opts *AiModelQueryOptions) ([]*AiModelManage, int64, error) { |
|
|
|
builder.Eq{"ai_model_manage.status": opts.Status}, |
|
|
|
) |
|
|
|
} |
|
|
|
orCon := builder.NewCond() |
|
|
|
orCon = orCon.And(builder.Eq{"ai_model_manage.is_private": false}) |
|
|
|
|
|
|
|
cond = cond.Or(orCon) |
|
|
|
|
|
|
|
if !opts.IsOnlyThisRepo { |
|
|
|
orCon := builder.NewCond() |
|
|
|
orCon = orCon.And(builder.Eq{"ai_model_manage.is_private": false}) |
|
|
|
cond = cond.Or(orCon) |
|
|
|
} |
|
|
|
count, err := sess.Where(cond).Count(new(AiModelManage)) |
|
|
|
if err != nil { |
|
|
|
return nil, 0, fmt.Errorf("Count: %v", err) |
|
|
|
|