houzhongjian
2024-12-05 a709abfd8ffec1524cefff30c3581f4425695433
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
@@ -16,12 +16,16 @@
import com.iailab.module.model.mdk.sample.SampleConstructor;
import com.iailab.module.model.mdk.sample.dto.SampleData;
import com.iailab.module.model.mdk.vo.PredictResultVO;
import com.iailab.module.model.mpk.common.MdkConstant;
import com.iailab.module.model.mpk.common.utils.DllUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
@@ -65,6 +69,11 @@
            }
            IAILModel newModelBean = composeNewModelBean(predictModel);
            HashMap<String, Object> settings = getPredictSettingsByModelId(modelId);
            // 校验setting必须有pyFile,否则可能导致程序崩溃
            if (!settings.containsKey(MdkConstant.PY_FILE_KEY)) {
                throw new RuntimeException("模型设置参数缺少必要信息【" + MdkConstant.PY_FILE_KEY +  "】,请重新上传模型!");
            }
            if (settings == null) {
                log.error("模型setting不存在,modelId=" + modelId);
                return null;