| @@ -1,7 +1,5 @@ | |||||
| {{template "base/head" .}} | {{template "base/head" .}} | ||||
| <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-modelmanage-local-create-1.css?v={{MD5 AppVer}}" /> | <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-modelmanage-local-create-1.css?v={{MD5 AppVer}}" /> | ||||
| <style></style> | |||||
| {{$repository := .Repository.ID}} | |||||
| <div class="repository release dataset-list view"> | <div class="repository release dataset-list view"> | ||||
| {{template "repo/header" .}} | {{template "repo/header" .}} | ||||
| <div class="ui container"> | <div class="ui container"> | ||||
| @@ -1,7 +1,5 @@ | |||||
| {{template "base/head" .}} | {{template "base/head" .}} | ||||
| <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-modelmanage-local-create-2.css?v={{MD5 AppVer}}" /> | <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-modelmanage-local-create-2.css?v={{MD5 AppVer}}" /> | ||||
| <style></style> | |||||
| {{$repository := .Repository.ID}} | |||||
| <div class="repository release dataset-list view"> | <div class="repository release dataset-list view"> | ||||
| {{template "repo/header" .}} | {{template "repo/header" .}} | ||||
| <div class="ui container"> | <div class="ui container"> | ||||
| @@ -1,50 +0,0 @@ | |||||
| import service from "../service"; | |||||
| import Qs from 'qs'; | |||||
| // 上传文件1: 获取文件chunks信息 | |||||
| // params: { md5, type: 0-CPU/GPU,1-NPU, file_name, scene: ''-数据集,'model'-模型 } | |||||
| // return: uploadID, uuid, uploaded, chunks, attachID, datasetID(), datasetName(), fileName | |||||
| export const getChunks = (params) => { | |||||
| return service({ | |||||
| url: `/attachments/get_chunks`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| // 上传文件2: 上传新文件 | |||||
| // params: { totalChunkCounts, md5, size, fileType, type, file_name, scene=model, modeluuid=xxxx } | |||||
| // return: uploadID, uuid | |||||
| export const getNewMultipart = (params) => { | |||||
| return service({ | |||||
| url: `/attachments/new_multipart`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| // 上传文件3: 获取分片上传地址 | |||||
| // params: { uuid, uploadID, size, chunkNumber, type, file_name, scene=model } | |||||
| // return: url | |||||
| export const getMultipartUrl = (params) => { | |||||
| return service({ | |||||
| url: `/attachments/get_multipart_url`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| // 上传文件4: 完成上传后 | |||||
| // data: { uuid, uploadID, size, type, file_name, dataset_id, description, scene=model, modeluuid=xxxx } | |||||
| export const setCompleteMultipart = (data) => { | |||||
| return service({ | |||||
| url: `/attachments/complete_multipart`, | |||||
| method: 'post', | |||||
| headers: { 'Content-type': 'application/x-www-form-urlencoded' }, | |||||
| params: {}, | |||||
| data: Qs.stringify(data), | |||||
| }); | |||||
| }; | |||||
| @@ -33,3 +33,63 @@ export const getModelInfoByName = (params) => { | |||||
| data: {}, | data: {}, | ||||
| }); | }); | ||||
| }; | }; | ||||
| // 求模型中文件列表 | |||||
| // params {repo, ID, parentDir} | |||||
| export const getModelFiles = (params) => { | |||||
| return service({ | |||||
| url: `${params.repo}/modelmanage/query_onelevel_modelfile`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| /* 文件上传相关 */ | |||||
| // 上传文件1: 获取文件chunks信息 | |||||
| // params: { md5, type: 0-CPU/GPU,1-NPU, file_name, scene: 'model', modeluuid } | |||||
| // return: uploadID, uuid, uploaded, chunks, attachID, modeluuid, modelName, fileName | |||||
| export const getChunks = (params) => { | |||||
| return service({ | |||||
| url: `/attachments/get_chunks`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| // 上传文件2: 上传新文件 | |||||
| // params: { totalChunkCounts, md5, size, fileType, type, file_name, scene=model, modeluuid=xxxx } | |||||
| // return: uploadID, uuid | |||||
| export const getNewMultipart = (params) => { | |||||
| return service({ | |||||
| url: `/attachments/new_multipart`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| // 上传文件3: 获取分片上传地址 | |||||
| // params: { uuid, uploadID, size, chunkNumber, type, file_name, scene=model } | |||||
| // return: url | |||||
| export const getMultipartUrl = (params) => { | |||||
| return service({ | |||||
| url: `/attachments/get_multipart_url`, | |||||
| method: 'get', | |||||
| params, | |||||
| data: {}, | |||||
| }); | |||||
| }; | |||||
| // 上传文件4: 完成上传后 | |||||
| // data: { uuid, uploadID, size, type, file_name, dataset_id, description, scene=model, modeluuid=xxxx } | |||||
| export const setCompleteMultipart = (data) => { | |||||
| return service({ | |||||
| url: `/attachments/complete_multipart`, | |||||
| method: 'post', | |||||
| headers: { 'Content-type': 'application/x-www-form-urlencoded' }, | |||||
| params: {}, | |||||
| data: Qs.stringify(data), | |||||
| }); | |||||
| }; | |||||
| @@ -14,3 +14,6 @@ export const AI_CENTER = [{ k: 'OpenIOne', v: i18n.t('resourcesManagement.OpenIO | |||||
| export const COMPUTER_RESOURCES = [{ k: 'GPU', v: 'GPU' }, { k: 'NPU', v: 'NPU' }, { k: 'MLU', v: 'MLU' }]; | export const COMPUTER_RESOURCES = [{ k: 'GPU', v: 'GPU' }, { k: 'NPU', v: 'NPU' }, { k: 'MLU', v: 'MLU' }]; | ||||
| export const ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }]; | export const ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }]; | ||||
| export const SPECIFICATION_STATUS = [{ k: '1', v: i18n.t('resourcesManagement.willOnShelf') }, { k: '2', v: i18n.t('resourcesManagement.onShelf') }, { k: '3', v: i18n.t('resourcesManagement.offShelf') }]; | export const SPECIFICATION_STATUS = [{ k: '1', v: i18n.t('resourcesManagement.willOnShelf') }, { k: '2', v: i18n.t('resourcesManagement.onShelf') }, { k: '3', v: i18n.t('resourcesManagement.offShelf') }]; | ||||
| // 模型 | |||||
| export const MODEL_ENGINES = [{ k: '0', v: 'PyTorch' }, { k: '1', v: 'TensorFlow' }, { k: '2', v: 'MindSpore' }, { k: '4', v: 'PaddlePaddle' }, { k: '5', v: 'OneFlow' }, { k: '6', v: 'MXNet' }, { k: '3', v: 'Other' }]; | |||||
| @@ -104,9 +104,8 @@ | |||||
| <script> | <script> | ||||
| import { saveLocalModel, getModelInfoByName, modifyModel } from '~/apis/modules/modelmanage'; | import { saveLocalModel, getModelInfoByName, modifyModel } from '~/apis/modules/modelmanage'; | ||||
| // import { CLUSTERS, COMPUTER_RESOURCES, ACC_CARD_TYPE } from '~/const'; | |||||
| import { getUrlSearchParams } from '~/utils'; | import { getUrlSearchParams } from '~/utils'; | ||||
| // import { formatDate } from 'element-ui/lib/utils/date-util'; | |||||
| import { MODEL_ENGINES } from '~/const' | |||||
| const REPO_NAME = location.pathname.split('/')[2]; | const REPO_NAME = location.pathname.split('/')[2]; | ||||
| @@ -123,13 +122,12 @@ export default { | |||||
| label: '', | label: '', | ||||
| description: '', | description: '', | ||||
| }, | }, | ||||
| engineList: [{ k: '0', v: 'PyTorch' }, { k: '1', v: 'TensorFlow' }, { k: '2', v: 'MindSpore' }, { k: '4', v: 'PaddlePaddle' }, { k: '5', v: 'OneFlow' }, { k: '6', v: 'MXNet' }, { k: '3', v: 'Other' }], | |||||
| engineList: MODEL_ENGINES, | |||||
| }; | }; | ||||
| }, | }, | ||||
| components: { /*QueueDialog*/ }, | |||||
| components: {}, | |||||
| methods: { | methods: { | ||||
| submit() { | submit() { | ||||
| console.log(this.state); | |||||
| if (!this.state.name) { | if (!this.state.name) { | ||||
| this.$message({ | this.$message({ | ||||
| type: 'info', | type: 'info', | ||||
| @@ -327,8 +325,6 @@ export default { | |||||
| margin-right: 5px; | margin-right: 5px; | ||||
| } | } | ||||
| .txt {} | |||||
| &.focused { | &.focused { | ||||
| border-color: rgb(50, 145, 248); | border-color: rgb(50, 145, 248); | ||||
| color: rgb(50, 145, 248); | color: rgb(50, 145, 248); | ||||
| @@ -76,8 +76,7 @@ | |||||
| import 'dropzone/dist/dropzone.css'; | import 'dropzone/dist/dropzone.css'; | ||||
| import Dropzone from 'dropzone'; | import Dropzone from 'dropzone'; | ||||
| import SparkMD5 from "spark-md5"; | import SparkMD5 from "spark-md5"; | ||||
| import { getModelInfoByName } from '~/apis/modules/modelmanage'; | |||||
| import { getChunks, getNewMultipart, getMultipartUrl, setCompleteMultipart } from '~/apis/modules/fileupload'; | |||||
| import { getModelInfoByName, getChunks, getNewMultipart, getMultipartUrl, setCompleteMultipart } from '~/apis/modules/modelmanage'; | |||||
| import { getUrlSearchParams } from '~/utils'; | import { getUrlSearchParams } from '~/utils'; | ||||
| Dropzone.autoDiscover = false; | Dropzone.autoDiscover = false; | ||||
| @@ -224,6 +223,7 @@ export default { | |||||
| return getChunks({ | return getChunks({ | ||||
| md5: file.uniqueIdentifier, | md5: file.uniqueIdentifier, | ||||
| type: this.state.type, | type: this.state.type, | ||||
| modeluuid: this.state.id, | |||||
| file_name: file.name, | file_name: file.name, | ||||
| scene: 'model', | scene: 'model', | ||||
| }).then(res => { | }).then(res => { | ||||
| @@ -3,7 +3,7 @@ export const getListValueWithKey = (list, key, k = 'k', v = 'v') => { | |||||
| const listI = list[i]; | const listI = list[i]; | ||||
| if (listI[k] === key) return listI[v]; | if (listI[k] === key) return listI[v]; | ||||
| } | } | ||||
| return ''; | |||||
| return key; | |||||
| }; | }; | ||||
| export const getUrlSearchParams = () => { | export const getUrlSearchParams = () => { | ||||