bug
This commit is contained in:
parent
593328dff1
commit
d31908d6c7
@ -143,4 +143,11 @@ public class ModelServiceController {
|
||||
return success(chat);
|
||||
}
|
||||
|
||||
@GetMapping("/download")
|
||||
@Operation(summary = "下载模型")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public List<String> download(@RequestParam("id") Long id){
|
||||
return modelServiceService.getDownLoadList(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -62,6 +62,8 @@ public class ModelServiceDO extends BaseDO {
|
||||
*/
|
||||
private Long jobId;
|
||||
|
||||
private String baseModelName;
|
||||
|
||||
private String apiKey;
|
||||
|
||||
private String apiUrl;
|
||||
|
||||
@ -77,13 +77,17 @@ public class LLMBackendProperties {
|
||||
|
||||
private String applicationApi;
|
||||
|
||||
private String modelServiceApi;
|
||||
|
||||
private String modelCreate;
|
||||
|
||||
private String modelDeploy;
|
||||
|
||||
private String modelUndeploy;
|
||||
|
||||
|
||||
private String modelServiceApi;
|
||||
private String tableDataQuery;
|
||||
|
||||
private String modelFileList;
|
||||
|
||||
private String modelFileDownload;
|
||||
}
|
||||
|
||||
@ -69,6 +69,7 @@ public class AsyncModelServiceService {
|
||||
AigcModelCreateRespVO aigcModelCreateRespVO = trainHttpService.modelCreate(new HashMap<>(), aIgcModelDeploySaveReq);
|
||||
log.info("model create info {}",aigcModelCreateRespVO);
|
||||
updateObj.setJobId(aigcModelCreateRespVO.getId());
|
||||
updateObj.setBaseModelName(aigcModelCreateRespVO.getBaseModelName());
|
||||
modelServiceMapper.updateById(updateObj);
|
||||
|
||||
|
||||
|
||||
@ -5,11 +5,14 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.llm.framework.backend.config.LLMBackendProperties;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -73,4 +76,15 @@ public class ModelService {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型下载列表
|
||||
*/
|
||||
public List<String> getFileList(String fileName){
|
||||
String url = llmBackendProperties.getModelFileList() + fileName;
|
||||
String res = HttpUtils.get(url, null);
|
||||
log.info(" getFileList:{}", res);
|
||||
return JSONArray.parseArray(res, String.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,13 +7,10 @@ import cn.iocoder.yudao.module.llm.framework.backend.config.LLMBackendProperties
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
||||
@ -66,4 +66,6 @@ public interface ModelServiceService {
|
||||
PageResult<ModelServiceRespVO> getModelServicePage1(ModelServicePageReqVO pageReqVO);
|
||||
|
||||
ModelServiceDO getByApiKey(String apiKey);
|
||||
|
||||
List<String> getDownLoadList(Long id);
|
||||
}
|
||||
|
||||
@ -12,11 +12,13 @@ import cn.iocoder.yudao.module.llm.dal.mysql.finetuningtask.FineTuningTaskMapper
|
||||
import cn.iocoder.yudao.module.llm.dal.mysql.modelservice.ModelServiceMapper;
|
||||
import cn.iocoder.yudao.module.llm.framework.backend.config.LLMBackendProperties;
|
||||
import cn.iocoder.yudao.module.llm.service.async.AsyncModelServiceService;
|
||||
import cn.iocoder.yudao.module.llm.service.http.ModelService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
@ -47,6 +49,9 @@ public class ModelServiceServiceImpl implements ModelServiceService {
|
||||
@Resource
|
||||
private LLMBackendProperties llmBackendProperties;
|
||||
|
||||
@Resource
|
||||
private ModelService modelService;
|
||||
|
||||
|
||||
@Override
|
||||
public Long createModelService(ModelServiceSaveReqVO createReqVO) {
|
||||
@ -57,7 +62,7 @@ public class ModelServiceServiceImpl implements ModelServiceService {
|
||||
// 插入
|
||||
String apikey = getApikey();
|
||||
modelService.setApiKey(apikey);
|
||||
String replace = llmBackendProperties.getApplicationApi().replace("apiKey", apikey);
|
||||
String replace = llmBackendProperties.getModelServiceApi().replace("apiKey", apikey);
|
||||
modelService.setApiUrl(replace);
|
||||
|
||||
modelServiceMapper.insert(modelService);
|
||||
@ -184,4 +189,17 @@ public class ModelServiceServiceImpl implements ModelServiceService {
|
||||
return modelServiceMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDownLoadList(Long id) {
|
||||
ModelServiceDO modelServiceDO = modelServiceMapper.selectById(id);
|
||||
String baseModelName = modelServiceDO.getBaseModelName();
|
||||
List<String> fileList = modelService.getFileList(baseModelName);
|
||||
String modelFileDownload = llmBackendProperties.getModelFileDownload();
|
||||
List<String> res = new ArrayList<>();
|
||||
for (String fileName : fileList) {
|
||||
res.add(modelFileDownload + baseModelName + "/" + fileName);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -262,7 +262,12 @@ llm:
|
||||
|
||||
application_api: http://localhost:48100/admin-app/llm/application/api/apiKey/chat
|
||||
|
||||
model_service_api : http://localhost:48100/admin-app/llm/model-service/api/apiKey/chat
|
||||
model_service_api: http://localhost:48100/admin-app/llm/model-service/api/apiKey/chat
|
||||
|
||||
model_file_list: http://36.133.1.230:5123/models/?path=
|
||||
|
||||
model_file_download: http://36.133.1.230:5123/models/download/?file_path=
|
||||
|
||||
|
||||
--- #################### iot相关配置 TODO 芋艿:再瞅瞅 ####################
|
||||
iot:
|
||||
|
||||
@ -301,10 +301,15 @@ llm:
|
||||
model_completions: http://api.xhllm.xinnuojinzhi.com/model/v1/chat/completions
|
||||
# aigc表数据查询接口
|
||||
table_data_query: http://36.133.1.230:5123/table/%s
|
||||
|
||||
application_api: http://localhost:48080/admin-app/llm/application/api/apiKey/chat
|
||||
|
||||
model_service_api : http://localhost:48080/admin-app/llm/model-service/api/apiKey/chat
|
||||
|
||||
model_file_list: http://36.133.1.230:5123/models/?path=
|
||||
|
||||
model_file_download: http://36.133.1.230:5123/models/download/?file_path=
|
||||
|
||||
--- #################### iot相关配置 TODO 芋艿:再瞅瞅 ####################
|
||||
iot:
|
||||
emq:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user