Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lmp_server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmp
lmp_server
Commits
def4bcbe
Commit
def4bcbe
authored
Dec 07, 2023
by
linpeiqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小bug
parent
11d98239
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
+33
-5
ModelEstimateController.java
...yice/webadmin/app/controller/ModelEstimateController.java
+32
-3
TuningRunController.java
...com/yice/webadmin/app/controller/TuningRunController.java
+1
-2
No files found.
application-webadmin/src/main/java/com/yice/webadmin/app/controller/ModelEstimateController.java
View file @
def4bcbe
...
...
@@ -165,7 +165,7 @@ public class ModelEstimateController {
public
ResponseEntity
<
Resource
>
getLog
(
@RequestParam
Long
taskId
)
throws
IOException
{
ModelEstimate
modelEstimate
=
this
.
modelEstimateService
.
getById
(
taskId
);
ModelVersion
modelVersion
=
this
.
modelVersionService
.
getById
(
modelEstimate
.
getModelVersionId
());
String
url
=
this
.
pythonConfig
.
getModelEstimateFileBaseDir
()
+
File
.
separator
+
modelVersion
.
getModelUrl
()
+
File
.
separator
+
"evl_"
+
taskId
+
File
.
separator
+
"run_eval.log"
;
String
url
=
this
.
pythonConfig
.
getModelEstimateFileBaseDir
()
+
modelVersion
.
getVersionName
()
+
File
.
separator
+
"evl_"
+
taskId
+
File
.
separator
+
"run_eval.log"
;
return
FileUtil
.
getFileByUrl
(
url
);
}
...
...
@@ -179,7 +179,7 @@ public class ModelEstimateController {
public
ResponseResult
<
String
>
getStatus
(
@RequestParam
Long
taskId
)
throws
IOException
{
ModelEstimate
modelEstimate
=
this
.
modelEstimateService
.
getById
(
taskId
);
ModelVersion
modelVersion
=
this
.
modelVersionService
.
getById
(
modelEstimate
.
getModelVersionId
());
String
url
=
this
.
pythonConfig
.
getModelEstimateFileBaseDir
()
+
File
.
separator
+
modelVersion
.
getModelUrl
()
+
File
.
separator
+
"evl_"
+
taskId
+
File
.
separator
+
"all_results.json"
;
String
url
=
this
.
pythonConfig
.
getModelEstimateFileBaseDir
()
+
modelVersion
.
getVersionName
()
+
File
.
separator
+
"evl_"
+
taskId
+
File
.
separator
+
"all_results.json"
;
File
file
=
new
File
(
url
);
// 指定文件路径
ObjectMapper
objectMapper
=
new
ObjectMapper
();
return
ResponseResult
.
success
(
objectMapper
.
readTree
(
file
).
toString
());
...
...
@@ -194,7 +194,7 @@ public class ModelEstimateController {
public
ResponseResult
<
String
>
getStatusDetail
(
@RequestParam
Long
taskId
)
throws
IOException
{
ModelEstimate
modelEstimate
=
this
.
modelEstimateService
.
getById
(
taskId
);
ModelVersion
modelVersion
=
this
.
modelVersionService
.
getById
(
modelEstimate
.
getModelVersionId
());
String
url
=
this
.
pythonConfig
.
getModelEstimateFileBaseDir
()
+
File
.
separator
+
modelVersion
.
getModelUrl
()
+
File
.
separator
+
"evl_"
+
taskId
+
File
.
separator
+
"generated_predictions.jsonl"
;
String
url
=
this
.
pythonConfig
.
getModelEstimateFileBaseDir
()
+
modelVersion
.
getVersionName
()
+
File
.
separator
+
"evl_"
+
taskId
+
File
.
separator
+
"generated_predictions.jsonl"
;
File
file
=
new
File
(
url
);
// 指定文件路径
ObjectMapper
objectMapper
=
new
ObjectMapper
();
return
ResponseResult
.
success
(
objectMapper
.
readTree
(
file
).
toString
());
...
...
@@ -229,6 +229,35 @@ public class ModelEstimateController {
return
ResponseResult
.
success
(
modelEstimate
.
getTaskId
());
}
/**
* 修改模型评估数据,及其关联的从表数据。
*
* @param modelEstimateDto 修改后的对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@ApiOperationSupport
(
ignoreParameters
=
{
"modelEstimateDto.taskId"
,
"modelEstimateDto.searchString"
})
@OperationLog
(
type
=
SysOperationLogType
.
UPDATE
)
@PostMapping
(
"/updateById"
)
public
ResponseResult
<
Void
>
updateById
(
@MyRequestBody
ModelEstimateDto
modelEstimateDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
modelEstimateDto
,
true
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
ModelEstimate
modelEstimate
=
MyModelUtil
.
copyTo
(
modelEstimateDto
,
ModelEstimate
.
class
);
ModelEstimate
originalModelEstimate
=
modelEstimateService
.
getById
(
modelEstimate
.
getTaskId
());
if
(
originalModelEstimate
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [数据] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
originalModelEstimate
.
setTaskStatus
(
modelEstimate
.
getTaskStatus
());
if
(!
modelEstimateService
.
updateById
(
originalModelEstimate
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
return
ResponseResult
.
success
();
}
/**
* 删除模型评估数据。
*
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/controller/TuningRunController.java
View file @
def4bcbe
...
...
@@ -125,12 +125,11 @@ public class TuningRunController {
}
TuningRun
tuningRun
=
MyModelUtil
.
copyTo
(
tuningRunDto
,
TuningRun
.
class
);
TuningRun
originalTuningRun
=
tuningRunService
.
getById
(
tuningRun
.
getRunId
());
originalTuningRun
.
setRunStatus
(
tuningRun
.
getRunStatus
());
if
(
originalTuningRun
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [数据] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
originalTuningRun
.
setRunStatus
(
tuningRun
.
getRunStatus
());
if
(!
tuningRunService
.
updateById
(
originalTuningRun
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment