|
|
|
@ -60,8 +60,13 @@ public class RasaCmdServiceImpl implements RasaCmdService {
|
|
|
|
|
@Transactional
|
|
|
|
|
public String trainExec(RasaCmdArgumentVo argument) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
|
|
|
|
|
|
|
String domain = dataPath+"domain.yml";
|
|
|
|
|
List<String> cmds = ListUtil.toList(shellEnv, trainShell,config,dataPath,domain,modelsPath);
|
|
|
|
|
// /rasa/v3_jiazhuangxian/domain.yml domain的路径,应该是从zip文件中加压出来的文件的路径后面拼上/domain.yml
|
|
|
|
|
String domain = String.join(File.separator,dataPath,argument.getModelId(),"domain.yml");
|
|
|
|
|
// /rasa/v3_jiazhuangxian/ yml文件的路径,应该是从zip文件中加压出来的文件的路径,在配置文件中配置
|
|
|
|
|
String localDataPath = String.join(File.separator,dataPath,argument.getModelId());
|
|
|
|
|
// /rasa/models 生成出来的模型的存放路径,也写在配置文件里面
|
|
|
|
|
String localModelsPath = String.join(File.separator,modelsPath,argument.getModelId());
|
|
|
|
|
List<String> cmds = ListUtil.toList(shellEnv, trainShell,config,localDataPath,domain,localModelsPath);
|
|
|
|
|
|
|
|
|
|
cmds.add(argument.getFixedModelName());
|
|
|
|
|
|
|
|
|
@ -90,8 +95,10 @@ public class RasaCmdServiceImpl implements RasaCmdService {
|
|
|
|
|
log.info("runExec findUnusedPort is : {}",port);
|
|
|
|
|
|
|
|
|
|
// 2. 运行模型
|
|
|
|
|
String mPath = modelsPath+argument.getFixedModelName()+".tar.gz";
|
|
|
|
|
List<String> cmds = ListUtil.toList(shellEnv, runShell,mPath,endpoints,String.valueOf(port));
|
|
|
|
|
// 2.1 -m 参数对应的值 /rasa/models/aaa1111.tar.gz 指run的模型的路径,/rasa/models应该来自于配置文件,和训练时的--out是同一配置项;
|
|
|
|
|
// aaa1111.tar.gz这个,前面的文件名应该是--fixed-model-name指定的,.tar.gz是文件后缀,代码拼接
|
|
|
|
|
String localPath = String.join(File.separator,modelsPath,argument.getModelId(),argument.getFixedModelName(),".tar.gz");
|
|
|
|
|
List<String> cmds = ListUtil.toList(shellEnv, runShell,localPath,endpoints,String.valueOf(port));
|
|
|
|
|
|
|
|
|
|
log.info("runExec cmd : {}",StrUtil.join(" ",cmds));
|
|
|
|
|
|
|
|
|
@ -102,7 +109,7 @@ public class RasaCmdServiceImpl implements RasaCmdService {
|
|
|
|
|
rasaModelInfo.setModelId(argument.getModelId());
|
|
|
|
|
rasaModelInfo.setPort(port);
|
|
|
|
|
rasaModelInfo.setServerStatus(runIsSuccess(outMessageList)?1:0);
|
|
|
|
|
rasaModelInfo.setCmd(ListUtil.toList(shellEnv, runShell,mPath,endpoints));
|
|
|
|
|
rasaModelInfo.setCmd(ListUtil.toList(shellEnv, runShell,localPath,endpoints));
|
|
|
|
|
rasaModeService.saveOrUpdateByModelId(rasaModelInfo);
|
|
|
|
|
|
|
|
|
|
return String.join("\r\n",outMessageList);
|
|
|
|
|