feat(llm): 优化微调任务创建流程

- 增加日志记录
This commit is contained in:
Liuyang 2025-02-25 11:17:17 +08:00
parent 8984abcb3b
commit 36802463b8
3 changed files with 189 additions and 100 deletions

View File

@ -55,42 +55,95 @@ public class AsyncFineTuningTaskService {
//大模型平台创建调优任务
@Async
public void createTuning(FineTuningTaskDO fineTuningTask) {
// 记录开始创建任务的日志
log.info("异步创建。 开始创建微调任务,请求参数: {}", fineTuningTask);
try {
log.info("开始创建微调任务任务ID: {}", fineTuningTask.getId());
// 查询 GPU 类型对应的服务器信息
log.debug("正在查询 GPU 类型对应的服务器信息GPU 类型: {}", fineTuningTask.getGpuType());
ServerNameDO serverNameDO = serverNameMapper.selectById(fineTuningTask.getGpuType());
AigcFineTuningCreateReqVO req = getAigcFineTuningCreateReqVO(fineTuningTask);
BaseModelDO baseModelDO = baseModelMapper.selectById(fineTuningTask.getBaseModelId());
Long datasetId = fineTuningTask.getDataset();
DatasetRespVO dataset = datasetService.getDataset(datasetId);
// req.setFileId(dataset.getJobId());
if (baseModelDO != null){
req.setModel(baseModelDO.getAigcModelName());
}
List<DatasetQuestionRespVO> datasetQuestionList = datasetQuestionService.getDatasetQuestionList(dataset.getId());
DatasetDO datasetDO = BeanUtils.toBean(dataset, DatasetDO.class);
String fileUrl = dataSetService.JsonFileWriteFine(serverNameDO.getHost(), datasetDO, datasetQuestionList);
req.setDataset(StringUtils.isNotBlank(dataset.getDatasetFileUrl())?dataset.getDatasetFileUrl():"storage/json/2025/01/_xVKpfDH8.json");
req.setDataset(fileUrl);
req.setSuffix(active+"-"+String.valueOf(fineTuningTask.getId()));
FineTuningTaskDO updateObj = new FineTuningTaskDO();
if (serverNameDO == null){
if (serverNameDO == null) {
log.error("未找到 GPU 类型对应的服务器信息任务将被取消。GPU 类型: {}", fineTuningTask.getGpuType());
FineTuningTaskDO updateObj = new FineTuningTaskDO();
updateObj.setId(fineTuningTask.getId());
updateObj.setStatus(FinetuningTaskStatusEnum.CANCELLED.getStatus());
fineTuningTaskMapper.updateById(updateObj);
return;
}
AigcFineTuningCreateRespVO resp = trainHttpService.finetuningCreate(new HashMap<>(),serverNameDO.getHost(), req);
log.debug("服务器信息查询成功。服务器主机: {}", serverNameDO.getHost());
// 构建微调任务请求对象
log.debug("正在构建微调任务请求对象...");
AigcFineTuningCreateReqVO req = getAigcFineTuningCreateReqVO(fineTuningTask);
// 查询基础模型信息
log.debug("正在查询基础模型信息模型ID: {}", fineTuningTask.getBaseModelId());
BaseModelDO baseModelDO = baseModelMapper.selectById(fineTuningTask.getBaseModelId());
if (baseModelDO != null) {
req.setModel(baseModelDO.getAigcModelName());
log.debug("基础模型信息设置成功。模型名称: {}", baseModelDO.getAigcModelName());
} else {
log.warn("未找到基础模型信息模型ID: {}", fineTuningTask.getBaseModelId());
}
// 查询数据集信息
Long datasetId = fineTuningTask.getDataset();
log.debug("正在查询数据集信息数据集ID: {}", datasetId);
DatasetRespVO dataset = datasetService.getDataset(datasetId);
if (dataset == null) {
log.error("未找到数据集信息数据集ID: {}", datasetId);
throw new RuntimeException("数据集信息不存在");
}
log.debug("数据集信息查询成功。数据集名称: {}", dataset.getDatasetName());
// 查询数据集问题列表
log.debug("正在查询数据集问题列表数据集ID: {}", dataset.getId());
List<DatasetQuestionRespVO> datasetQuestionList = datasetQuestionService.getDatasetQuestionList(dataset.getId());
log.debug("数据集问题列表查询成功。问题数量: {}", datasetQuestionList.size());
// 将数据集信息转换为 DO 对象
log.debug("正在转换数据集信息为 DO 对象...");
DatasetDO datasetDO = BeanUtils.toBean(dataset, DatasetDO.class);
// 生成 JSON 文件并获取文件 URL
log.debug("正在生成 JSON 文件并获取文件 URL...");
String fileUrl = dataSetService.JsonFileWriteFine(serverNameDO.getHost(), datasetDO, datasetQuestionList);
req.setDataset(fileUrl);
log.debug("JSON 文件生成成功。文件 URL: {}", fileUrl);
// 设置请求参数
req.setSuffix(active + "-" + fineTuningTask.getId());
log.debug("请求参数设置完成。后缀: {}", req.getSuffix());
// 调用模型服务创建微调任务
log.info("正在调用模型服务创建微调任务...");
AigcFineTuningCreateRespVO resp = trainHttpService.finetuningCreate(new HashMap<>(), serverNameDO.getHost(), req);
// 更新任务状态
FineTuningTaskDO updateObj = new FineTuningTaskDO();
updateObj.setId(fineTuningTask.getId());
if (resp != null && resp.getId()!=0) {
if (resp != null && resp.getId() != 0) {
updateObj.setJobId(resp.getJobId());
updateObj.setStatus(FinetuningTaskStatusEnum.WAITING.getStatus());
updateObj.setJobModelName(resp.getFineTunedModel());
updateObj.setTrainLog(resp.getTrainLog());
log.info("微调任务创建成功。任务ID: {}, 任务状态: {}", fineTuningTask.getId(), FinetuningTaskStatusEnum.WAITING.getStatus());
} else {
updateObj.setStatus(FinetuningTaskStatusEnum.FAILED.getStatus());
log.error("微调任务创建失败。任务ID: {}", fineTuningTask.getId());
}
// 更新数据库
log.debug("正在更新数据库中的任务状态...");
fineTuningTaskMapper.updateById(updateObj);
} catch (Exception e){
log.info("数据库更新完成。任务ID: {}", fineTuningTask.getId());
} catch (Exception e) {
log.error("创建微调任务时发生异常。任务ID: {}", fineTuningTask.getId(), e);
e.printStackTrace();
};
}
}
private static AigcFineTuningCreateReqVO getAigcFineTuningCreateReqVO(FineTuningTaskDO fineTuningTask) {

View File

@ -69,14 +69,30 @@ public class FineTuningTaskServiceImpl implements FineTuningTaskService {
@Override
public Long createFineTuningTask (FineTuningTaskSaveReqVO createReqVO) {
// 插入
// 记录开始创建任务的日志
log.info("开始创建微调任务,请求参数: {}", createReqVO);
// 验证任务名称是否存在
validateFineTuningNameTaskExists(createReqVO);
log.debug("微调任务名称验证通过。");
// 转换请求对象为实体对象
FineTuningTaskDO fineTuningTask = BeanUtils.toBean(createReqVO, FineTuningTaskDO.class);
fineTuningTask.setStatus(FinetuningTaskStatusEnum.WAITING.getStatus());
log.debug("将请求对象转换为 FineTuningTaskDO 转换完成。FineTuningTaskDO: {}", fineTuningTask);
// 插入任务到数据库
fineTuningTaskMapper.insert(fineTuningTask);
//todo 调用模型服务创建调优任务
log.info("微调任务插入成功。任务ID: {}", fineTuningTask.getId());
// 异步调用模型服务创建调优任务
log.debug("正在异步调用模型服务,创建微调任务...");
asyncFineTuningTaskService.createTuning(fineTuningTask);
// 返回
log.info("已成功发起异步微调任务创建。任务ID: {}", fineTuningTask.getId());
// 返回任务ID
log.info("微调任务创建成功。返回任务ID: {}", fineTuningTask.getId());
return fineTuningTask.getId();
}

View File

@ -11,12 +11,11 @@ import kong.unirest.HttpResponse;
import kong.unirest.Unirest;
import kong.unirest.UnirestException;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -36,7 +35,7 @@ public class TrainHttpService {
/**
* 训练集列表 GET
*/
public String datasetList(Map<String, String> headers){
public String datasetList (Map<String, String> headers) {
String datasetList = llmBackendProperties.getDatasetList();
String res = HttpUtils.get(datasetList, headers);
return res;
@ -45,7 +44,7 @@ public class TrainHttpService {
/**
* 上传训练集 POST
*/
public String datasetCreate(Map<String, String> headers, String body){
public String datasetCreate (Map<String, String> headers, String body) {
String datasetCreate = llmBackendProperties.getDatasetCreate();
String res = HttpUtils.post(datasetCreate, headers, body);
return res;
@ -54,7 +53,7 @@ public class TrainHttpService {
/**
* 删除训练集 DELETE
*/
public String datasetDelete(Map<String,String> headers){
public String datasetDelete (Map<String, String> headers) {
String datasetDelete = llmBackendProperties.getDatasetDelete();
String res = HttpUtils.del(datasetDelete, headers);
return res;
@ -63,7 +62,7 @@ public class TrainHttpService {
/**
* 训练集标注 GET
*/
public String annotationTaskList(Map<String, String> headers){
public String annotationTaskList (Map<String, String> headers) {
String annotationTaskList = llmBackendProperties.getAnnotationTaskList();
String res = HttpUtils.get(annotationTaskList, headers);
return res;
@ -72,7 +71,7 @@ public class TrainHttpService {
/**
* 标注信息 GET
*/
public String annotationTask(Map<String, String> headers){
public String annotationTask (Map<String, String> headers) {
String annotationTask = llmBackendProperties.getAnnotationTask();
String res = HttpUtils.get(annotationTask, headers);
return res;
@ -82,7 +81,7 @@ public class TrainHttpService {
/**
* 保存标注 POST
*/
public String annotationTaskSave(Map<String, String> headers, String body){
public String annotationTaskSave (Map<String, String> headers, String body) {
String annotationTaskSave = llmBackendProperties.getAnnotationTaskSave();
String res = HttpUtils.post(annotationTaskSave, headers, body);
return res;
@ -91,9 +90,9 @@ public class TrainHttpService {
/**
* 大模型列表 GET
*/
public String modelsList(String modelName){
public String modelsList (String modelName) {
Map<String, String> headers = new HashMap<>();
// login(headers);
// login(headers);
String modelsList = llmBackendProperties.getModelsList();
String res = HttpUtils.get(modelsList + "?modelName=" + modelName, headers);
return res;
@ -102,7 +101,7 @@ public class TrainHttpService {
/**
* 基础模型列表 GET
*/
public String baseModelList(Map<String, String> headers){
public String baseModelList (Map<String, String> headers) {
String baseModelList = llmBackendProperties.getBaseModelList();
String res = HttpUtils.get(baseModelList, headers);
return res;
@ -111,15 +110,15 @@ public class TrainHttpService {
/**
* 登录 POST
*/
public AigcLoginRespVO login(Map<String, String> headers){
public AigcLoginRespVO login (Map<String, String> headers) {
headers.put("Content-Type", "application/json");
headers.put("Pragma", "no-cache");
String login = llmBackendProperties.getLogin();
AigcLoginReqVO req = new AigcLoginReqVO(llmBackendProperties.getLoginUsername(), llmBackendProperties.getLoginPassword());
String res = HttpUtils.post(login, headers, JSON.toJSONString(req));
String res = HttpUtils.post(login, headers, JSON.toJSONString(req));
log.info("登录接口返回:{}", res);
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null){
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null) {
AigcLoginRespVO aigcLoginRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcLoginRespVO.class);
headers.put("X-Token", aigcLoginRespVO.getToken());
AigcAccountRespVO aigcAccountRespVO = account(headers);
@ -133,12 +132,12 @@ public class TrainHttpService {
return null;
}
public AigcAccountRespVO account(Map<String, String> headers){
public AigcAccountRespVO account (Map<String, String> headers) {
String account = llmBackendProperties.getAccount();
String res = HttpUtils.get(account, headers);
log.info(" account:{}", res);
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null){
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null) {
AigcAccountRespVO aigcAccountRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcAccountRespVO.class);
log.info(" account:{}", aigcAccountRespVO);
return aigcAccountRespVO;
@ -149,51 +148,70 @@ public class TrainHttpService {
/**
* 创建微调任务 POST
*/
public AigcFineTuningCreateRespVO finetuningCreate(Map<String, String> headers,String url, AigcFineTuningCreateReqVO req){
// login(headers);
// TODO: 在上个方法中已经将数据集的文件id赋予调试时需要写死再放开
// String fileId = "6237ed4d-a046-479c-80d6-8579a0283994";
// req.setFileId(fileId);
log.info(" finetuningCreate:{}", JSON.toJSONString(req));
String res = HttpUtils.post(url+llmBackendProperties.getFinetuningCreate(), headers, JSON.toJSONString(req));
log.info(" finetuningCreate:{}", res);
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
var aigcFineTuningCreateRespVO = JSON.parseObject(res, AigcFineTuningCreateRespVO.class);
log.info(" finetuningCreate:{}", aigcFineTuningCreateRespVO);
return aigcFineTuningCreateRespVO;
public AigcFineTuningCreateRespVO finetuningCreate (Map<String, String> headers, String url, AigcFineTuningCreateReqVO req) {
// login(headers);
// TODO: 在上个方法中已经将数据集的文件id赋予调试时需要写死再放开
// String fileId = "6237ed4d-a046-479c-80d6-8579a0283994";
// req.setFileId(fileId);
try {
// 记录请求信息
log.info("开始创建微调任务请求URL: {}", url + llmBackendProperties.getFinetuningCreate());
log.debug("请求头: {}", headers);
log.debug("请求体: {}", JSON.toJSONString(req));
// 发起 HTTP 请求
log.debug("正在发起 HTTP POST 请求...");
String res = HttpUtils.post(url + llmBackendProperties.getFinetuningCreate(), headers, JSON.toJSONString(req));
log.info("HTTP 请求完成。响应内容: {}", res);
// 解析响应
log.debug("正在解析响应内容...");
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
AigcFineTuningCreateRespVO aigcFineTuningCreateRespVO = JSON.parseObject(res, AigcFineTuningCreateRespVO.class);
log.info("响应解析完成。微调任务创建结果: {}", JSON.toJSONString(aigcFineTuningCreateRespVO));
// 返回结果
return aigcFineTuningCreateRespVO;
} catch (Exception e) {
log.error("创建微调任务时发生异常。请求URL: {}", url + llmBackendProperties.getFinetuningCreate(), e);
throw new RuntimeException("微调任务创建失败", e);
}
}
/**
* 根据表名称查询数据
*/
public String modelTableQuery(Map<String, String> headers, String urlHost,String tableName,String query){
String url = String.format(urlHost+llmBackendProperties.getTableDataQuery(),tableName);
url = url+query;
public String modelTableQuery (Map<String, String> headers, String urlHost, String tableName, String query) {
String url = String.format(urlHost + llmBackendProperties.getTableDataQuery(), tableName);
url = url + query;
String res = HttpUtils.get(url, headers);
log.info(" model query info :{}", res);
return res;
}
public AigcFineTuningDetailRespVO finetuningDetail(Map<String, String> headers, String jobId){
public AigcFineTuningDetailRespVO finetuningDetail (Map<String, String> headers, String jobId) {
login(headers);
String finetuningDetail = llmBackendProperties.getFinetuningDetail();
String res = HttpUtils.get(finetuningDetail + "/" + jobId, headers);
log.info(" finetuningDetail:{}", res);
try {
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null){
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null) {
AigcFineTuningDetailRespVO aigcFineTuningDetailRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcFineTuningDetailRespVO.class);
log.info(" finetuningDetail:{}", aigcFineTuningDetailRespVO);
return aigcFineTuningDetailRespVO;
}
}catch (Exception e){
} catch (Exception e) {
log.error(" finetuningDetail:{}", e.getMessage());
}
return null;
}
public AigcRespVO finetuningDelete(Map<String, String> headers, String jobId) {
public AigcRespVO finetuningDelete (Map<String, String> headers, String jobId) {
login(headers);
String finetuningDetail = llmBackendProperties.getFinetuningDetail();
String res = HttpUtils.del(finetuningDetail + "/" + jobId, headers);
@ -203,7 +221,7 @@ public class TrainHttpService {
return aigcRespVO;
}
public String finetuningFileList(Map<String, String> headers) {
public String finetuningFileList (Map<String, String> headers) {
String finetuningFileList = llmBackendProperties.getFinetuningFileList();
String res = HttpUtils.get(finetuningFileList, headers);
log.info(" finetuningFileList:{}", res);
@ -211,21 +229,21 @@ public class TrainHttpService {
}
public String autoEvaluation(String url,String prompt,String dataSetPrompt) {
public String autoEvaluation (String url, String prompt, String dataSetPrompt) {
// test
Map<String,String> map = new HashMap<>();
map.put("accept","application/json");
map.put("Content-Type","application/json");
Map<String, String> map = new HashMap<>();
map.put("accept", "application/json");
map.put("Content-Type", "application/json");
String autoEvaluation = llmBackendProperties.getAutoEvaluation();
JSONObject jsonObject = new JSONObject();
jsonObject.put("prompt",prompt);
jsonObject.put("dataSetPrompt",dataSetPrompt);
List<String> dimension = Stream.of("事实性错误","情感倾向性","语义连贯性").collect(Collectors.toList());
jsonObject.put("dimension",dimension);
jsonObject.put("prompt", prompt);
jsonObject.put("dataSetPrompt", dataSetPrompt);
List<String> dimension = Stream.of("事实性错误", "情感倾向性", "语义连贯性").collect(Collectors.toList());
jsonObject.put("dimension", dimension);
String body = JSONObject.toJSONString(jsonObject);
log.info(" autoEvaluation body :{}", body);
log.info(" autoEvaluation url :{}", url+autoEvaluation);
String res = HttpUtils.post(url+autoEvaluation, map, body);
log.info(" autoEvaluation url :{}", url + autoEvaluation);
String res = HttpUtils.post(url + autoEvaluation, map, body);
log.info(" autoEvaluation:{}", res);
JSONObject resJson = JSONObject.parseObject(res);
JSONObject response = resJson.getJSONObject("response");
@ -237,23 +255,23 @@ public class TrainHttpService {
/**
* 模型对话 POST
*/
public String modelCompletions(Map<String, String> headers, String body){
public String modelCompletions (Map<String, String> headers, String body) {
String finetuningCreate = llmBackendProperties.getModelCompletions();
String res = HttpUtils.post(finetuningCreate, headers, body);
return res;
}
public ModelDeployRespVO modelDeploy(Map<String, String> headers,String url,AigcModelDeploySaveReq req){
// login(headers);
public ModelDeployRespVO modelDeploy (Map<String, String> headers, String url, AigcModelDeploySaveReq req) {
// login(headers);
String modelDeploy = llmBackendProperties.getModelDeploy();
log.info(" modelDeploy request:{}", JSON.toJSONString(req));
String res = HttpUtils.post(url+modelDeploy, headers, JSON.toJSONString(req));
String res = HttpUtils.post(url + modelDeploy, headers, JSON.toJSONString(req));
log.info(" modelDeploy:{}", res);
JSONObject parseObject = JSON.parseObject(res);
ModelDeployRespVO modelDeployRespVO=new ModelDeployRespVO();
ModelDeployRespVO modelDeployRespVO = new ModelDeployRespVO();
log.info("--- {}",parseObject);
if(parseObject.containsKey("error") ){
log.info("--- {}", parseObject);
if (parseObject.containsKey("error")) {
modelDeployRespVO.setMessage("error");
return modelDeployRespVO;
}
@ -261,10 +279,11 @@ public class TrainHttpService {
return modelDeployRespVO;
}
public AigcModelDeployVO modelUndeploy(Map<String, String> headers,String url, Long deployId) {
// login(headers);
public AigcModelDeployVO modelUndeploy (Map<String, String> headers, String url, Long deployId) {
// login(headers);
String modelDeploy = llmBackendProperties.getModelUndeploy();
String res = HttpUtils.post(url+modelDeploy + deployId, headers,"");
String res = HttpUtils.post(url + modelDeploy + deployId, headers, "");
log.info(" modelDeploy:{}", res);
AigcModelDeployVO modelDeployRespVO = JSON.parseObject(res, AigcModelDeployVO.class);
log.info(" modelDeploy:{}", modelDeployRespVO);
@ -274,13 +293,13 @@ public class TrainHttpService {
/**
* 模型服务创建
*/
public AigcModelCreateRespVO modelCreate(Map<String, String> headers, AIgcModelCreateSaveReq req) {
// login(headers);
public AigcModelCreateRespVO modelCreate (Map<String, String> headers, AIgcModelCreateSaveReq req) {
// login(headers);
String modelDeploy = llmBackendProperties.getModelCreate();
String res = HttpUtils.post(modelDeploy, headers, JSON.toJSONString(req));
log.info(" modelDeploy:{}", res);
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null){
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null) {
AigcModelCreateRespVO aigcModelCreateRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcModelCreateRespVO.class);
log.info(" modelDeploy:{}", aigcModelCreateRespVO);
return aigcModelCreateRespVO;
@ -291,6 +310,7 @@ public class TrainHttpService {
/**
* AIGC文件上传
*
* @param headers
* @param inputStream
* @param fileName
@ -298,35 +318,35 @@ public class TrainHttpService {
* @throws UnirestException
* @throws IOException
*/
public AigcDatasetFileRespV0 AigcUploadFile(Map<String, String> headers, String url,InputStream inputStream, String fileName) throws UnirestException, IOException {
public AigcDatasetFileRespV0 AigcUploadFile (Map<String, String> headers, String url, InputStream inputStream, String fileName) throws UnirestException, IOException {
String aigcFileUpload = llmBackendProperties.getAigcFileUpload();
// login(headers);
// login(headers);
headers.remove("Content-Type");
try {
try {
// 上传文件
HttpResponse<String> uploadResponse = Unirest.post(url+aigcFileUpload)
HttpResponse<String> uploadResponse = Unirest.post(url + aigcFileUpload)
.headers(headers)
.field("file", inputStream, fileName)
.field("purpose", "fine-tune")
.asString();
log.info("Response Body: " + uploadResponse.getBody());
AigcRespVO aigcRespVO = JSON.parseObject(uploadResponse.getBody(), AigcRespVO.class);
if (aigcRespVO.isSuccess()){
if (aigcRespVO.isSuccess()) {
AigcDatasetFileRespV0 aigcDatasetFileRespV0 = JSON.parseObject(aigcRespVO.getData().toString(), AigcDatasetFileRespV0.class);
log.info("模型工厂上传文件 aigcDatasetFileRespV0:{}", aigcDatasetFileRespV0);
return aigcDatasetFileRespV0;
}
return null;
}catch (Exception e){
} catch (Exception e) {
return null;
}
}
public AigcRespVO finetuningCancle(Map<String, String> headers, String jobId) {
// login(headers);
public AigcRespVO finetuningCancle (Map<String, String> headers, String jobId) {
// login(headers);
String finetuningCancel = llmBackendProperties.getFinetuningCancel();
String url = String.format(finetuningCancel,jobId);
String url = String.format(finetuningCancel, jobId);
String res = HttpUtils.del(url, headers);
log.info(" finetuningDelete:{}", res);
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
@ -335,19 +355,19 @@ public class TrainHttpService {
}
public String getTrainLog(String url,String params) {
public String getTrainLog (String url, String params) {
String finetuningLog = llmBackendProperties.getFinetuningLog();
return HttpUtils.get(url+finetuningLog+params, null);
return HttpUtils.get(url + finetuningLog + params, null);
}
public String getCheckFileList(String url,String name){
public String getCheckFileList (String url, String name) {
String checkFileList = llmBackendProperties.getCheckFileList();
return HttpUtils.get(url+checkFileList + name, null);
return HttpUtils.get(url + checkFileList + name, null);
}
public String getCheckFile(String url,String name,String path){
public String getCheckFile (String url, String name, String path) {
String checkFileList = llmBackendProperties.getCheckFileList();
return url+checkFileList + name + "&&file_path=" + path;
return url + checkFileList + name + "&&file_path=" + path;
}
}