使用默认参数推理

This commit is contained in:
2023-06-21 16:13:52 +08:00
parent 2a71384fad
commit 1d0da612b8
4 changed files with 40 additions and 16 deletions

View File

@@ -61,11 +61,11 @@ func init() {
func (model *Model) Inference(image_list []Image, callback func()) {
log.Println(image_list)
callback()
// 模型未部署到推理機
if model.ServerID == "" {
log.Println("模型未部署到推理機, 开始部署模型")
if model.ServerID != "" {
//log.Println("模型未部署到推理機, 开始部署模型")
log.Println("模型已部署到推理機, 开始推理模型")
var server Server
if err := configs.ORMDB().Where("models LIKE ?", "%"+model.Name+"%").Take(&server).Error; err != nil {
@@ -190,8 +190,9 @@ func (model *Model) Inference(image_list []Image, callback func()) {
}
}
}
callback()
}
log.Println("模型未部署到推理機, 取消推理模型")
}
// 将base64编码的图片保存到本地webp