mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 20:25:12 +00:00
(improvement)(script) build runtime directory in supersonic-daemon.bat (#208)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -31,6 +31,9 @@ set requirementPath="%baseDir%/../chat/core/src/main/python/requirements.txt"
|
|||||||
%pip_path% install -r %requirementPath%
|
%pip_path% install -r %requirementPath%
|
||||||
echo "install python modules success"
|
echo "install python modules success"
|
||||||
|
|
||||||
|
call :BUILD_RUNTIME
|
||||||
|
|
||||||
|
:BUILD_RUNTIME
|
||||||
rem 6. reset runtime
|
rem 6. reset runtime
|
||||||
rd /s /q "%runtimeDir%"
|
rd /s /q "%runtimeDir%"
|
||||||
mkdir "%runtimeDir%"
|
mkdir "%runtimeDir%"
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ if "%service%"=="" (
|
|||||||
set "service=%standalone_service%"
|
set "service=%standalone_service%"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
call :BUILD_RUNTIME
|
||||||
|
|
||||||
if "%command%"=="restart" (
|
if "%command%"=="restart" (
|
||||||
call :STOP
|
call :STOP
|
||||||
call :START
|
call :START
|
||||||
@@ -97,3 +99,20 @@ if "%command%"=="restart" (
|
|||||||
cd "%runtimeDir%\supersonic-standalone\llmparser\sql"
|
cd "%runtimeDir%\supersonic-standalone\llmparser\sql"
|
||||||
start %python_path% examples_reload_run.py
|
start %python_path% examples_reload_run.py
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
|
:BUILD_RUNTIME
|
||||||
|
rem 6. reset runtime
|
||||||
|
if exist "%runtimeDir%" goto :EOF
|
||||||
|
mkdir "%runtimeDir%"
|
||||||
|
tar -zxvf "%buildDir%\supersonic-standalone.tar.gz" -C "%runtimeDir%"
|
||||||
|
for /d %%f in ("%runtimeDir%\launchers-standalone-*") do (
|
||||||
|
move "%%f" "%runtimeDir%\supersonic-standalone"
|
||||||
|
)
|
||||||
|
|
||||||
|
rem 7. copy webapp to runtime
|
||||||
|
tar -zxvf "%buildDir%\supersonic-webapp.tar.gz" -C "%buildDir%"
|
||||||
|
if not exist "%runtimeDir%\supersonic-standalone\webapp" mkdir "%runtimeDir%\supersonic-standalone\webapp"
|
||||||
|
xcopy /s /e /h /y "%buildDir%\supersonic-webapp\*" "%runtimeDir%\supersonic-standalone\webapp"
|
||||||
|
if not exist "%runtimeDir%\supersonic-standalone\conf\webapp" mkdir "%runtimeDir%\supersonic-standalone\conf\webapp"
|
||||||
|
xcopy /s /e /h /y "%runtimeDir%\supersonic-standalone\webapp\*" "%runtimeDir%\supersonic-standalone\conf\webapp"
|
||||||
|
rd /s /q "%buildDir%\supersonic-webapp"
|
||||||
@@ -205,11 +205,10 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
List<SolvedQueryRecallResp> solvedQueryRecallResps = solvedQueryManager.recallSolvedQuery(queryText, agentId);
|
List<SolvedQueryRecallResp> solvedQueryRecallResps = solvedQueryManager.recallSolvedQuery(queryText, agentId);
|
||||||
List<Long> queryIds = solvedQueryRecallResps.stream()
|
List<Long> queryIds = solvedQueryRecallResps.stream()
|
||||||
.map(SolvedQueryRecallResp::getQueryId).collect(Collectors.toList());
|
.map(SolvedQueryRecallResp::getQueryId).collect(Collectors.toList());
|
||||||
List<Long> queryIds = solvedQueryRecallResps.stream().map(SolvedQueryRecallResp::getQueryId)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
PageQueryInfoReq pageQueryInfoReq = new PageQueryInfoReq();
|
PageQueryInfoReq pageQueryInfoReq = new PageQueryInfoReq();
|
||||||
pageQueryInfoReq.setIds(queryIds);
|
pageQueryInfoReq.setIds(queryIds);
|
||||||
pageQueryInfoReq.setPageSize(100);
|
pageQueryInfoReq.setPageSize(100);
|
||||||
|
pageQueryInfoReq.setCurrent(1);
|
||||||
//2. remove low score query
|
//2. remove low score query
|
||||||
int lowScoreThreshold = 3;
|
int lowScoreThreshold = 3;
|
||||||
PageInfo<QueryResp> queryRespPageInfo = chatQueryRepository.getChatQuery(pageQueryInfoReq, null);
|
PageInfo<QueryResp> queryRespPageInfo = chatQueryRepository.getChatQuery(pageQueryInfoReq, null);
|
||||||
|
|||||||
@@ -205,11 +205,7 @@ public class QueryServiceImpl implements QueryService {
|
|||||||
if (queryReq.isSaveAnswer() && QueryState.SUCCESS.equals(queryResult.getQueryState())) {
|
if (queryReq.isSaveAnswer() && QueryState.SUCCESS.equals(queryResult.getQueryState())) {
|
||||||
chatCtx.setParseInfo(parseInfo);
|
chatCtx.setParseInfo(parseInfo);
|
||||||
chatService.updateContext(chatCtx);
|
chatService.updateContext(chatCtx);
|
||||||
solvedQueryManager.saveSolvedQuery(SolvedQueryReq.builder().parseId(queryReq.getParseId())
|
saveSolvedQuery(queryReq, parseInfo, chatQueryDO, queryResult);
|
||||||
.queryId(queryReq.getQueryId())
|
|
||||||
.agentId(chatQueryDO.getAgentId())
|
|
||||||
.modelId(parseInfo.getModelId())
|
|
||||||
.queryText(queryReq.getQueryText()).build());
|
|
||||||
}
|
}
|
||||||
chatCtx.setQueryText(queryReq.getQueryText());
|
chatCtx.setQueryText(queryReq.getQueryText());
|
||||||
chatCtx.setUser(queryReq.getUser().getName());
|
chatCtx.setUser(queryReq.getUser().getName());
|
||||||
@@ -242,6 +238,18 @@ public class QueryServiceImpl implements QueryService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void saveSolvedQuery(ExecuteQueryReq queryReq, SemanticParseInfo parseInfo,
|
||||||
|
ChatQueryDO chatQueryDO, QueryResult queryResult) {
|
||||||
|
if (queryResult.getResponse() == null && CollectionUtils.isEmpty(queryResult.getQueryResults())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
solvedQueryManager.saveSolvedQuery(SolvedQueryReq.builder().parseId(queryReq.getParseId())
|
||||||
|
.queryId(queryReq.getQueryId())
|
||||||
|
.agentId(chatQueryDO.getAgentId())
|
||||||
|
.modelId(parseInfo.getModelId())
|
||||||
|
.queryText(queryReq.getQueryText()).build());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResult executeQuery(QueryReq queryReq) throws Exception {
|
public QueryResult executeQuery(QueryReq queryReq) throws Exception {
|
||||||
QueryContext queryCtx = new QueryContext(queryReq);
|
QueryContext queryCtx = new QueryContext(queryReq);
|
||||||
|
|||||||
Reference in New Issue
Block a user