| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.iail.model.IAILModel; |
| | | import com.iailab.module.model.common.enums.CommonConstant; |
| | | import com.iailab.module.model.enums.CommonConstant; |
| | | import com.iailab.module.model.common.enums.OutResultType; |
| | | import com.iailab.module.model.common.exception.ModelResultErrorException; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmModelArithSettingsEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictModelEntity; |
| | | import com.iailab.module.model.mcs.pre.enums.ItemRunStatusEnum; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemOutputService; |
| | | import com.iailab.module.model.mcs.pre.service.MmModelArithSettingsService; |
| | | import com.iailab.module.model.mdk.common.enums.TypeA; |
| | |
| | | } |
| | | String modelId = predictModel.getId(); |
| | | try { |
| | | List<SampleData> sampleDataList = sampleConstructor.constructSample(TypeA.Predict.name(), modelId, predictTime, itemName); |
| | | List<SampleData> sampleDataList = sampleConstructor.constructSample(TypeA.Predict.name(), modelId, predictTime, itemName, new HashMap<>()); |
| | | String modelPath = predictModel.getModelpath(); |
| | | if (modelPath == null) { |
| | | log.info("模型路径不存在,modelId=" + modelId); |
| | |
| | | result.setModelResult(modelResult); |
| | | result.setPredictTime(predictTime); |
| | | } catch (ModelResultErrorException ex) { |
| | | ex.printStackTrace(); |
| | | // ex.printStackTrace(); |
| | | log.error("模型结果异常", ex); |
| | | throw ex; |
| | | } catch (Exception ex) { |
| | | // log.error("调用发生异常,异常信息为:{0}", ex.getMessage()); |
| | | ex.printStackTrace(); |
| | | // ex.printStackTrace(); |
| | | log.error("模型运行异常", ex); |
| | | throw new ModelInvokeException(ex.getMessage()); |
| | | } |
| | | return result; |