Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
42d86d8697
@ -49,4 +49,6 @@ public class BaseModelPageReqVO extends PageParam {
|
||||
@Schema(description = "代理")
|
||||
private String proxy;
|
||||
|
||||
@Schema(description = "aigc平台id")
|
||||
private Long aigcId;
|
||||
}
|
||||
|
@ -58,4 +58,7 @@ public class BaseModelRespVO {
|
||||
@Schema(description = "代理")
|
||||
private String proxy;
|
||||
|
||||
@Schema(description = "aigc平台id")
|
||||
private Long aigcId;
|
||||
|
||||
}
|
||||
|
@ -48,4 +48,6 @@ public class BaseModelSaveReqVO {
|
||||
@Schema(description = "代理")
|
||||
private String proxy;
|
||||
|
||||
@Schema(description = "aigc平台id")
|
||||
private Long aigcId;
|
||||
}
|
||||
|
@ -68,4 +68,9 @@ public class BaseModelDO extends BaseDO {
|
||||
*/
|
||||
private String proxy;
|
||||
|
||||
/**
|
||||
* augc平台的id
|
||||
*/
|
||||
private Long aigcId;
|
||||
|
||||
}
|
||||
|
@ -58,6 +58,9 @@ public class LLMBackendProperties {
|
||||
|
||||
@NotNull(message = "登录 POST")
|
||||
private String login;
|
||||
private String account;
|
||||
private String loginUsername;
|
||||
private String loginPassword;
|
||||
|
||||
@NotNull(message = "基础模型列表 GET")
|
||||
private String baseModelList;
|
||||
@ -67,4 +70,8 @@ public class LLMBackendProperties {
|
||||
|
||||
@NotNull(message = "创建微调任务 POST")
|
||||
private String finetuningCreate;
|
||||
|
||||
private String finetuningDetail;
|
||||
|
||||
private String finetuningFileList;
|
||||
}
|
||||
|
@ -3,6 +3,9 @@ package cn.iocoder.yudao.module.llm.service.async;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.finetuningtask.FineTuningTaskDO;
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.finetuningtask.FineTuningTaskMapper;
|
||||
import cn.iocoder.yudao.module.llm.service.http.TrainHttpService;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.AigcFineTuningCreateReqVO;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.AigcFineTuningCreateRespVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -10,6 +13,7 @@ import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AsyncFineTuningTaskService {
|
||||
|
||||
@Resource
|
||||
@ -22,9 +26,10 @@ public class AsyncFineTuningTaskService {
|
||||
@Async
|
||||
public void createTuning(FineTuningTaskDO fineTuningTask) {
|
||||
try {
|
||||
trainHttpService.finetuningCreate(new HashMap<>(),new String());
|
||||
}catch(Exception e){
|
||||
|
||||
AigcFineTuningCreateReqVO req = new AigcFineTuningCreateReqVO();
|
||||
AigcFineTuningCreateRespVO resp = trainHttpService.finetuningCreate(new HashMap<>(), req);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -54,4 +54,6 @@ public interface BaseModelService {
|
||||
|
||||
List<BaseModelDO> getBaseModelList();
|
||||
|
||||
BaseModelDO getByAigcId(Long id);
|
||||
|
||||
}
|
||||
|
@ -1,22 +1,20 @@
|
||||
package cn.iocoder.yudao.module.llm.service.basemodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.BaseModelPageReqVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.BaseModelSaveReqVO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.basemodel.BaseModelMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.basemodel.BaseModelMapper;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.BASE_MODEL_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 基座模型 Service 实现类
|
||||
@ -81,4 +79,11 @@ public class BaseModelServiceImpl implements BaseModelService {
|
||||
return baseModelDOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseModelDO getByAigcId(Long id) {
|
||||
LambdaQueryWrapper<BaseModelDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BaseModelDO::getAigcId,id);
|
||||
return baseModelMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.llm.service.basemodel;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.BaseModelSaveReqVO;
|
||||
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
|
||||
import cn.iocoder.yudao.module.llm.service.basemodel.vo.ModelListRes;
|
||||
import cn.iocoder.yudao.module.llm.service.http.TrainHttpService;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.esotericsoftware.minlog.Log;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class BaseModelTaskService {
|
||||
|
||||
@Resource
|
||||
TrainHttpService trainHttpService;
|
||||
|
||||
@Resource
|
||||
BaseModelService baseModelService;
|
||||
|
||||
|
||||
@Scheduled(cron ="0 0 0/1 * * ?")
|
||||
public void updateBaseModel() {
|
||||
Log.info("定时任务启动");
|
||||
String resStr = trainHttpService.modelsList();
|
||||
Log.info("获取aicg模型列表返回数据内容{}",resStr);
|
||||
JSONObject jsonObject = JSONObject.parseObject(resStr);
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
JSONArray list = data.getJSONArray("list");
|
||||
String s = list.toJSONString();
|
||||
List<ModelListRes> modelListRes = JSONObject.parseArray(s, ModelListRes.class);
|
||||
for (ModelListRes modelListRe : modelListRes) {
|
||||
Long id = modelListRe.getId();
|
||||
BaseModelDO byAigcId = baseModelService.getByAigcId(id);
|
||||
if(byAigcId == null){
|
||||
BaseModelSaveReqVO baseModelSaveReqVO = new BaseModelSaveReqVO();
|
||||
baseModelSaveReqVO.setAigcId(id);
|
||||
baseModelSaveReqVO.setModelName(modelListRe.getModelName());
|
||||
baseModelSaveReqVO.setModelType(modelListRe.getModelType());
|
||||
baseModelSaveReqVO.setMaxContextLength(modelListRe.getMaxTokens());
|
||||
baseModelSaveReqVO.setIsActive(modelListRe.getEnabled());
|
||||
baseModelSaveReqVO.setIsFinetuned(modelListRe.getIsFineTuning());
|
||||
baseModelSaveReqVO.setNotes(modelListRe.getRemark());
|
||||
baseModelSaveReqVO.setParameterCount(1);
|
||||
baseModelService.createBaseModel(baseModelSaveReqVO);
|
||||
}else{
|
||||
BaseModelSaveReqVO baseModelSaveReqVO = new BaseModelSaveReqVO();
|
||||
baseModelSaveReqVO.setId(byAigcId.getId());
|
||||
baseModelSaveReqVO.setParameterCount(1);
|
||||
baseModelSaveReqVO.setModelName(modelListRe.getModelName());
|
||||
baseModelSaveReqVO.setModelType(modelListRe.getModelType());
|
||||
baseModelSaveReqVO.setMaxContextLength(modelListRe.getMaxTokens());
|
||||
baseModelSaveReqVO.setIsActive(modelListRe.getEnabled());
|
||||
baseModelSaveReqVO.setIsFinetuned(modelListRe.getIsFineTuning());
|
||||
baseModelSaveReqVO.setNotes(modelListRe.getRemark());
|
||||
baseModelService.updateBaseModel(baseModelSaveReqVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.llm.service.basemodel.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModelListRes {
|
||||
|
||||
private Long id;
|
||||
|
||||
//模型名称
|
||||
private String modelName;
|
||||
|
||||
//最长上下文长度
|
||||
private Integer maxTokens;
|
||||
|
||||
//模型类型
|
||||
private String modelType;
|
||||
|
||||
//备注
|
||||
private String remark;
|
||||
|
||||
//是否启用
|
||||
private Boolean enabled;
|
||||
|
||||
//是否微调
|
||||
private Boolean isFineTuning;
|
||||
|
||||
//部署状态
|
||||
private String deployStatus;
|
||||
}
|
@ -108,7 +108,12 @@ public class DatasetQuestionServiceImpl implements DatasetQuestionService {
|
||||
|
||||
@Override
|
||||
public void updateDatasetQuestionDataAnno(List<DatasetQuestionSaveReqVO> updateReqVOS) {
|
||||
updateReqVOS.forEach(updateReqVO -> {
|
||||
List<Long> ids = new ArrayList<>();
|
||||
Long datasetId = null;
|
||||
for (DatasetQuestionSaveReqVO updateReqVO : updateReqVOS){
|
||||
if (datasetId == null){
|
||||
datasetId = updateReqVO.getDatasetId();
|
||||
}
|
||||
DatasetQuestionDO datasetQuestionDO = BeanUtils.toBean(updateReqVO, DatasetQuestionDO.class);
|
||||
if (CollectionUtils.isNotEmpty(updateReqVO.getDatasetAnswerRespVO())){
|
||||
datasetQuestionDO.setStatus(2);
|
||||
@ -117,9 +122,33 @@ public class DatasetQuestionServiceImpl implements DatasetQuestionService {
|
||||
List<DatasetAnswerSaveReqVO> datasetAnswerSaveReqVO = updateReqVO.getDatasetAnswerRespVO();
|
||||
List<DatasetAnswerDO> datasetAnswerDOS = BeanUtils.toBean(datasetAnswerSaveReqVO, DatasetAnswerDO.class);
|
||||
if (CollectionUtils.isNotEmpty(datasetAnswerDOS)){
|
||||
datasetAnswerMapper.insertOrUpdate(datasetAnswerDOS);
|
||||
for (DatasetAnswerDO datasetAnswerDO : datasetAnswerDOS){
|
||||
if (datasetAnswerDO.getId() == null){
|
||||
datasetAnswerMapper.insert(datasetAnswerDO);
|
||||
ids.add(datasetAnswerDO.getId());
|
||||
}else {
|
||||
ids.add(datasetAnswerDO.getId());
|
||||
datasetAnswerMapper.updateById(datasetAnswerDO);
|
||||
}
|
||||
}
|
||||
// datasetAnswerMapper.insertOrUpdate(datasetAnswerDOS);
|
||||
}
|
||||
});
|
||||
}
|
||||
LambdaQueryWrapper<DatasetAnswerDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(datasetId!= null,DatasetAnswerDO::getDatasetId, datasetId);
|
||||
List<DatasetAnswerDO> datasetAnswerDOS = datasetAnswerMapper.selectList(queryWrapper);
|
||||
List<Long> collect = datasetAnswerDOS.stream().map(DatasetAnswerDO::getId).collect(Collectors.toList());
|
||||
List<Long> diff1 = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(collect)){
|
||||
HashSet<Long> set1 = new HashSet<>(ids);
|
||||
HashSet<Long> set2 = new HashSet<>(collect);
|
||||
// 获取 set2 中有但 set1 中没有的元素
|
||||
set2.removeAll(set1);
|
||||
diff1 = new ArrayList<>(set2);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(diff1)){
|
||||
datasetAnswerMapper.deleteBatchIds(diff1);
|
||||
}
|
||||
// 标注进度修改
|
||||
LambdaQueryWrapper<DatasetQuestionDO> wrapper = new LambdaQueryWrapper<DatasetQuestionDO>()
|
||||
.eq(DatasetQuestionDO::getDatasetId, updateReqVOS.get(0).getDatasetId());
|
||||
@ -132,4 +161,4 @@ public class DatasetQuestionServiceImpl implements DatasetQuestionService {
|
||||
datasetMapper.updateProcess(formattedRatio, updateReqVOS.get(0).getDatasetId(),status);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,23 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
|
||||
import cn.iocoder.yudao.module.llm.framework.backend.config.LLMBackendProperties;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.RagEmbedReqVo;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.RagQueryMultipleReqVo;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.RagQueryReqVo;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 训练相关接口
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TrainHttpService {
|
||||
|
||||
@Resource
|
||||
@ -80,7 +81,9 @@ public class TrainHttpService {
|
||||
/**
|
||||
* 大模型列表 GET
|
||||
*/
|
||||
public String modelsList(Map<String, String> headers){
|
||||
public String modelsList(){
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
login(headers);
|
||||
String modelsList = llmBackendProperties.getModelsList();
|
||||
String res = HttpUtils.get(modelsList, headers);
|
||||
return res;
|
||||
@ -98,18 +101,89 @@ public class TrainHttpService {
|
||||
/**
|
||||
* 登录 POST
|
||||
*/
|
||||
public String login(Map<String, String> headers, String body){
|
||||
public AigcLoginRespVO login(Map<String, String> headers){
|
||||
headers.put("Content-Type", "application/json");
|
||||
headers.put("Pragma", "no-cache");
|
||||
String login = llmBackendProperties.getLogin();
|
||||
String res = HttpUtils.post(login, headers, body);
|
||||
return res;
|
||||
AigcLoginReqVO req = new AigcLoginReqVO(llmBackendProperties.getLoginUsername(), llmBackendProperties.getLoginPassword());
|
||||
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){
|
||||
AigcLoginRespVO aigcLoginRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcLoginRespVO.class);
|
||||
headers.put("X-Token", aigcLoginRespVO.getToken());
|
||||
AigcAccountRespVO aigcAccountRespVO = account(headers);
|
||||
if (aigcAccountRespVO != null && CollUtil.isNotEmpty(aigcAccountRespVO.getTenants())) {
|
||||
aigcLoginRespVO.setTenantId(aigcAccountRespVO.getTenants().get(0).getId());
|
||||
headers.put("X-Tenant-Id", aigcLoginRespVO.getTenantId());
|
||||
log.info(" login:{}", aigcAccountRespVO);
|
||||
return aigcLoginRespVO;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
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){
|
||||
AigcAccountRespVO aigcAccountRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcAccountRespVO.class);
|
||||
log.info(" account:{}", aigcAccountRespVO);
|
||||
return aigcAccountRespVO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建微调任务 POST
|
||||
*/
|
||||
public String finetuningCreate(Map<String, String> headers, String body){
|
||||
public AigcFineTuningCreateRespVO finetuningCreate(Map<String, String> headers, AigcFineTuningCreateReqVO req){
|
||||
login(headers);
|
||||
String finetuningCreate = llmBackendProperties.getFinetuningCreate();
|
||||
String res = HttpUtils.post(finetuningCreate, headers, body);
|
||||
// TODO: 暂时先固定一个微调文件ID
|
||||
String fileId = "5c4e33fb-7ae2-4a48-9a78-fb74e4634d16";
|
||||
req.setFileId(fileId);
|
||||
String res = HttpUtils.post(finetuningCreate, headers, JSON.toJSONString(req));
|
||||
log.info(" finetuningCreate:{}", res);
|
||||
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
|
||||
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null){
|
||||
AigcFineTuningCreateRespVO aigcFineTuningCreateRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcFineTuningCreateRespVO.class);
|
||||
log.info(" finetuningCreate:{}", aigcFineTuningCreateRespVO);
|
||||
return aigcFineTuningCreateRespVO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
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);
|
||||
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
|
||||
if (aigcRespVO.isSuccess() && aigcRespVO.getData() != null){
|
||||
AigcFineTuningDetailRespVO aigcFineTuningDetailRespVO = JSON.parseObject(aigcRespVO.getData().toString(), AigcFineTuningDetailRespVO.class);
|
||||
log.info(" finetuningDetail:{}", aigcFineTuningDetailRespVO);
|
||||
return aigcFineTuningDetailRespVO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public AigcRespVO finetuningDelete(Map<String, String> headers, String jobId) {
|
||||
login(headers);
|
||||
String finetuningDetail = llmBackendProperties.getFinetuningDetail();
|
||||
String res = HttpUtils.del(finetuningDetail + "/" + jobId, headers);
|
||||
log.info(" finetuningDelete:{}", res);
|
||||
AigcRespVO aigcRespVO = JSON.parseObject(res, AigcRespVO.class);
|
||||
log.info(" finetuningDelete:{}", aigcRespVO);
|
||||
return aigcRespVO;
|
||||
}
|
||||
|
||||
public String finetuningFileList(Map<String, String> headers) {
|
||||
String finetuningFileList = llmBackendProperties.getFinetuningFileList();
|
||||
String res = HttpUtils.get(finetuningFileList, headers);
|
||||
log.info(" finetuningFileList:{}", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcAccountRespVO {
|
||||
|
||||
// 租户列表,由于JSON中是一个数组,所以这里用List<Tenant>来表示
|
||||
private List<Tenant> tenants;
|
||||
// 电子邮件地址
|
||||
private String email;
|
||||
// 昵称
|
||||
private String nickname;
|
||||
// 语言设置
|
||||
private String language;
|
||||
|
||||
// 嵌套的Tenant类,用于表示租户信息
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class Tenant {
|
||||
|
||||
// 租户ID
|
||||
private String id;
|
||||
// 租户名称
|
||||
private String name;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcFineTuningCreateReqVO {
|
||||
|
||||
private String scenario = "general";
|
||||
private String fileId = "48fac97c-5a69-4fde-9f77-86f4de2e91eb";
|
||||
private String baseModel;
|
||||
private int trainEpoch;
|
||||
private String suffix;
|
||||
private String remark;
|
||||
private int trainBatchSize;
|
||||
private int evalBatchSize;
|
||||
private int accumulationSteps;
|
||||
private int procPerNode;
|
||||
private double learningRate;
|
||||
private int modelMaxLength;
|
||||
private boolean lora;
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcFineTuningCreateRespVO {
|
||||
private int id;
|
||||
private String jobId;
|
||||
private String baseModel;
|
||||
private int trainEpoch;
|
||||
private String trainStatus;
|
||||
private String trainDuration;
|
||||
private int process;
|
||||
private String fineTunedModel;
|
||||
private String remark;
|
||||
private String finishedAt;
|
||||
private ZonedDateTime createdAt;
|
||||
private String trainPublisher;
|
||||
private String trainLog;
|
||||
private String errorMessage;
|
||||
private boolean lora;
|
||||
private TrainAnalysis trainAnalysis;
|
||||
private String suffix;
|
||||
private int modelMaxLength;
|
||||
private int trainBatchSize;
|
||||
private String learningRate; // Note: This is a string to preserve precision or format
|
||||
private String fileUrl;
|
||||
private String fileId;
|
||||
private String startTrainTime;
|
||||
private int procPerNode;
|
||||
private int evalBatchSize;
|
||||
private int accumulationSteps;
|
||||
private String scenario;
|
||||
private Map<String, Object> diagnosis;
|
||||
|
||||
|
||||
public static class TrainAnalysis {
|
||||
private EpochAnalysis epoch;
|
||||
private LossAnalysis loss;
|
||||
private LearningRateAnalysis learningRate;
|
||||
}
|
||||
|
||||
// Nested class for EpochAnalysis
|
||||
public static class EpochAnalysis {
|
||||
private List<Integer> list;
|
||||
}
|
||||
|
||||
// Nested class for LossAnalysis
|
||||
public static class LossAnalysis {
|
||||
private List<Double> list;
|
||||
|
||||
}
|
||||
|
||||
// Nested class for LearningRateAnalysis
|
||||
public static class LearningRateAnalysis {
|
||||
|
||||
private List<Double> list; // Or String list if learning rates are represented as strings
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcFineTuningDetailReqVO {
|
||||
private String jobId;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
public class AigcFineTuningDetailRespVO {
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcFineTuningFileListRespVO {
|
||||
private boolean success;
|
||||
private int code;
|
||||
private ListData data;
|
||||
private String message;
|
||||
private String traceId;
|
||||
|
||||
// 嵌套在顶层类中的 Data 类
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class ListData {
|
||||
private List<FaqFile> list;
|
||||
private int total;
|
||||
}
|
||||
|
||||
// 嵌套在 Data 类中的 FaqFile 类
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class FaqFile {
|
||||
private int size;
|
||||
private String createdAt;
|
||||
private String fileId;
|
||||
private String filename;
|
||||
private String purpose;
|
||||
private String fileType;
|
||||
private int tenantId;
|
||||
private String s3Url;
|
||||
private int lineCount;
|
||||
private int tokenCount;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcLoginReqVO {
|
||||
|
||||
private String username;
|
||||
private String password;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcLoginRespVO {
|
||||
|
||||
private String token;
|
||||
private String username;
|
||||
private String tenantId;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AigcRespVO {
|
||||
|
||||
private boolean success;
|
||||
private int code;
|
||||
private Object data;
|
||||
private String message;
|
||||
private String traceId;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.llm.service.modelassesstaskmanual;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataset.vo.DatasetAnswerRespVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataset.vo.DatasetQuestionPageReqVO;
|
||||
@ -120,6 +121,9 @@ public class ManualModelAnswerServiceImpl implements ManualModelAnswerService {
|
||||
.eq(ManualModelAnswerDO::getStatus,2)
|
||||
.isNotNull(ManualModelAnswerDO::getReqRespVos);
|
||||
List<ManualModelAnswerDO> manualModelAnswerDOS = manualModelAnswerMapper.selectList(wrapper);
|
||||
if (ObjectUtil.isAllEmpty(manualModelAnswerDOS)){
|
||||
return null;
|
||||
}
|
||||
List<LabelInformationVO> bean = BeanUtils.toBean(manualModelAnswerDOS.get(0).getReqRespVos(), LabelInformationVO.class);
|
||||
List<String> collect = bean.stream().map(LabelInformationVO::getLabel).collect(Collectors.toList());
|
||||
return collect;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.llm.service.modelassesstaskmanualbackup;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.dataset.vo.DatasetAnswerRespVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.modelassesstaskauto.vo.ModelAssessTaskAutoPageReqVO;
|
||||
import cn.iocoder.yudao.module.llm.controller.admin.modelassesstaskauto.vo.ModelAssessTaskAutoRespVO;
|
||||
@ -421,6 +422,9 @@ public class ModelAssessTaskManualBackupServiceImpl implements ModelAssessTaskMa
|
||||
.eq(ManualModelAnswerBackupDO::getStatus,2)
|
||||
.isNotNull(ManualModelAnswerBackupDO::getReqRespVos);
|
||||
List<ManualModelAnswerBackupDO> manualModelAnswerDOS = manualModelAnswerBackupMapper.selectList(wrapper);
|
||||
if (ObjectUtil.isAllEmpty(manualModelAnswerDOS)){
|
||||
return null;
|
||||
}
|
||||
List<LabelInformationVO> bean = BeanUtils.toBean(manualModelAnswerDOS.get(0).getReqRespVos(), LabelInformationVO.class);
|
||||
List<String> collect = bean.stream().map(LabelInformationVO::getLabel).collect(Collectors.toList());
|
||||
return collect;
|
||||
|
@ -50,4 +50,7 @@ public class UserPageReqVO extends PageParam {
|
||||
@Schema(description = "当userType为学生时 0 学生 1学员,当userType为教师时 0 教师 1培训教师", example = "1")
|
||||
private Integer statusType;
|
||||
|
||||
@Schema(description = "用户昵称", example = "yudao")
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
|
||||
.likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile())
|
||||
.likeIfPresent(AdminUserDO::getNickname, reqVO.getNickname())
|
||||
.eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(AdminUserDO::getUserType, reqVO.getUserType())
|
||||
.betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime())
|
||||
|
@ -233,11 +233,18 @@ llm:
|
||||
# 保存标注 POST
|
||||
annotation_task_save: http://localhost:8123/api/mgr/annotation/task/task-6025001b-692c-44a1-9bc7-2a34bd7c0efe/segment/das-2eedd7bf-3770-4816-a961-b30c446b7a4f/mark
|
||||
# 大模型列表 GET
|
||||
models_list: http://localhost:8123/api/models
|
||||
models_list: http://aigc.xhllm.xinnuojinzhi.com/api/models
|
||||
# 登录 POST
|
||||
login: http://localhost:8123/login
|
||||
login: http://aigc.xhllm.xinnuojinzhi.com/api/auth/login
|
||||
account: http://aigc.xhllm.xinnuojinzhi.com/api/auth/account
|
||||
login_username: admin
|
||||
login_password: admin
|
||||
# 创建微调任务 POST
|
||||
finetuning_create: http://localhost:8123/api/finetuning
|
||||
finetuning_create: http://aigc.xhllm.xinnuojinzhi.com/api/finetuning
|
||||
# 微调任务详情 GET
|
||||
finetuning_detail: http://aigc.xhllm.xinnuojinzhi.com/api/finetuning/
|
||||
# 微调文件列表 GET
|
||||
finetuning_file_list: http://aigc.xhllm.xinnuojinzhi.com/api/files?purpose=fine-tune
|
||||
|
||||
#### 大模型对话
|
||||
# 基础模型列表 GET
|
||||
|
@ -276,11 +276,18 @@ llm:
|
||||
# 保存标注 POST
|
||||
annotation_task_save: http://localhost:8123/api/mgr/annotation/task/task-6025001b-692c-44a1-9bc7-2a34bd7c0efe/segment/das-2eedd7bf-3770-4816-a961-b30c446b7a4f/mark
|
||||
# 大模型列表 GET
|
||||
models_list: http://localhost:8123/api/models
|
||||
models_list: http://aigc.xhllm.xinnuojinzhi.com/api/models
|
||||
# 登录 POST
|
||||
login: http://localhost:8123/login
|
||||
login: http://aigc.xhllm.xinnuojinzhi.com/api/auth/login
|
||||
account: http://aigc.xhllm.xinnuojinzhi.com/api/auth/account
|
||||
login_username: admin
|
||||
login_password: admin
|
||||
# 创建微调任务 POST
|
||||
finetuning_create: http://localhost:8123/api/finetuning
|
||||
finetuning_create: http://aigc.xhllm.xinnuojinzhi.com/api/finetuning
|
||||
# 微调任务详情 GET
|
||||
finetuning_detail: http://aigc.xhllm.xinnuojinzhi.com/api/finetuning/
|
||||
# 微调文件列表 GET
|
||||
finetuning_file_list: http://aigc.xhllm.xinnuojinzhi.com/api/files?purpose=fine-tune
|
||||
|
||||
#### 大模型对话
|
||||
# 模型列表 GET
|
||||
|
Loading…
x
Reference in New Issue
Block a user