|
@@ -22,6 +22,7 @@ import com.taais.common.core.utils.http.HttpUtils;
|
|
|
import com.taais.common.orm.core.page.PageQuery;
|
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
import jakarta.annotation.Resource;
|
|
|
+import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -218,14 +219,14 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
AlgorithmRequestDto algorithmRequestDto = new AlgorithmRequestDto();
|
|
|
algorithmRequestDto.setBizType(BizConstant.TYPE_DATA_BIZ_PROCESS);
|
|
|
algorithmRequestDto.setBizId(bizProcessVo.getId());
|
|
|
- algorithmRequestDto.setSourcePath(preprocessPath);
|
|
|
- algorithmRequestDto.setResultPath(resultPath);
|
|
|
+ algorithmRequestDto.setSourcePath(BizConstant.DOCKER_BASE_PATH + preprocessPath);
|
|
|
+ algorithmRequestDto.setResultPath(BizConstant.DOCKER_BASE_PATH + resultPath);
|
|
|
algorithmRequestDto.setLogPath(bizProcessVo.getLog());
|
|
|
Gson gson = new Gson();
|
|
|
Type listType = new TypeToken<List<AlgorithmConfigParamDto>>() {}.getType();
|
|
|
if (StringUtils.isNotEmpty(parameters)) {
|
|
|
List<AlgorithmConfigParamDto> paramDtoList = gson.fromJson(parameters, listType);
|
|
|
- Map<String, String> otherParams = new HashMap<>(paramDtoList.size());
|
|
|
+ Map<String, Object> otherParams = new HashMap<>(paramDtoList.size());
|
|
|
// todo allen 模型没加载进去
|
|
|
if (model == null) {
|
|
|
log.error("模型配置未找到!!!modelId:{}", modelId);
|
|
@@ -234,7 +235,12 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
otherParams.put("pretrained_model", model.getModelAddress());
|
|
|
}
|
|
|
for (AlgorithmConfigParamDto algorithmConfigParamDto : paramDtoList) {
|
|
|
- otherParams.put(algorithmConfigParamDto.getAgName(), StringUtils.isNotEmpty(algorithmConfigParamDto.getValue()) ? algorithmConfigParamDto.getValue() : algorithmConfigParamDto.getDefaultValue());
|
|
|
+ String value = StringUtils.isNotEmpty(algorithmConfigParamDto.getValue()) ? algorithmConfigParamDto.getValue() : algorithmConfigParamDto.getDefaultValue();
|
|
|
+ if(NumberUtils.isDigits(value)){
|
|
|
+ otherParams.put(algorithmConfigParamDto.getAgName(), NumberUtils.createFloat(value));
|
|
|
+ } else {
|
|
|
+ otherParams.put(algorithmConfigParamDto.getAgName(), value);
|
|
|
+ }
|
|
|
}
|
|
|
algorithmRequestDto.setOtherParams(otherParams);
|
|
|
}
|
|
@@ -283,16 +289,21 @@ public class AlgorithmSubtaskServiceImpl extends BaseServiceImpl<AlgorithmSubtas
|
|
|
AlgorithmRequestDto algorithmRequestDto = new AlgorithmRequestDto();
|
|
|
algorithmRequestDto.setBizType(BizConstant.TYPE_DATA_BIZ_PROCESS);
|
|
|
algorithmRequestDto.setBizId(processVo.getId());
|
|
|
- algorithmRequestDto.setSourcePath(preprocessPath);
|
|
|
- algorithmRequestDto.setResultPath(resultPath);
|
|
|
+ algorithmRequestDto.setSourcePath(BizConstant.DOCKER_BASE_PATH + preprocessPath);
|
|
|
+ algorithmRequestDto.setResultPath(BizConstant.DOCKER_BASE_PATH + resultPath);
|
|
|
algorithmRequestDto.setLogPath(processVo.getLog());
|
|
|
Gson gson = new Gson();
|
|
|
Type listType = new TypeToken<List<AlgorithmConfigParamDto>>() {}.getType();
|
|
|
if (StringUtils.isNotEmpty(parameters)) {
|
|
|
List<AlgorithmConfigParamDto> paramDtoList = gson.fromJson(parameters, listType);
|
|
|
- Map<String, String> otherParams = new HashMap<>(paramDtoList.size());
|
|
|
+ Map<String, Object> otherParams = new HashMap<>(paramDtoList.size());
|
|
|
for (AlgorithmConfigParamDto algorithmConfigParamDto : paramDtoList) {
|
|
|
- otherParams.put(algorithmConfigParamDto.getName(), StringUtils.isNotEmpty(algorithmConfigParamDto.getValue()) ? algorithmConfigParamDto.getValue() : algorithmConfigParamDto.getDefaultValue());
|
|
|
+ String value = StringUtils.isNotEmpty(algorithmConfigParamDto.getValue()) ? algorithmConfigParamDto.getValue() : algorithmConfigParamDto.getDefaultValue();
|
|
|
+ if(NumberUtils.isDigits(value)){
|
|
|
+ otherParams.put(algorithmConfigParamDto.getAgName(), NumberUtils.createFloat(value));
|
|
|
+ } else {
|
|
|
+ otherParams.put(algorithmConfigParamDto.getAgName(), value);
|
|
|
+ }
|
|
|
}
|
|
|
algorithmRequestDto.setOtherParams(otherParams);
|
|
|
}
|