Files
YG_FT/frontend/dist/assets/ModelCreateView-rx4YrtfV.js
wuyongtao 836343b29e feat: 新增 compute_gateway、compute_poller、agent 模块,重构前端 dist
- 新增 backend/app/modules/compute_gateway(client/sync)计算网关模块
- 新增 backend/app/workers/compute_poller 计算轮询 worker
- 新增 compute/agent/process_manager 进程管理器
- 新增 scripts/ 脚本目录
- 更新 Docker 部署配置(app/compute/nginx)
- 更新后端平台 API、数据库 SQL、core 配置
- 更新前端多个视图组件及 API 模块
- 重构 frontend/dist 构建产物(新 hash)
- 更新多项文档

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-22 20:26:16 +08:00

2 lines
7.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{a as $,E as j}from"./el-form-item-Bq0n_p5a.js";import{E as F}from"./el-popper-D1tByNLb.js";import{E as T}from"./index-h5FkzAP_.js";import{E as G}from"./index-BNsCyG4A.js";import{E as z,a as Y}from"./el-select-BD70by95.js";import{E as H,b as J}from"./el-radio-group-DxV9SE4w.js";import{v as Q}from"./directive-B1cwmVOz.js";import{d as W,aN as X,G as Z,K as ee,e as m,w as t,y as _,j as I,z as le,o as s,s as a,c as b,ad as L,f as oe,M as w,x as n,q as P,aa as ae,A as k,v as te,ac as re}from"./index-Ds9AETjS.js";import"./el-tooltip-l0sNRNKZ.js";import"./el-scrollbar-CF42LNzg.js";/* empty css */import{P as ue}from"./PageCard-CV3p14-x.js";import{c as ne,f as se,u as ie,h as pe}from"./model-cWd9CDtT.js";import{_ as de}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./castArray-BWI4UxBy.js";import"./_baseClone-CZxxnGCv.js";import"./index-BSbCLbaz.js";import"./index-sWKLi7bH.js";import"./raf-zQ00nuMI.js";import"./index-B0if-AHo.js";import"./vnode-CBiWHFw7.js";import"./index-CQlF36Lk.js";import"./index-ByhS8A1d.js";import"./scroll-DVmMv0d9.js";import"./clamp-CyhADbdq.js";import"./toNumber-DrayciwT.js";import"./_baseIteratee-82gB5Yov.js";import"./omit-BzI1MV_K.js";import"./el-card-D86TXgMv.js";const me={class:"model-path-row"},_e=W({__name:"ModelCreateView",setup(fe){const E=re(),M=te(),f=_(),c=_(!1),g=_(!1),y=I(()=>!!E.params.id),d=I(()=>E.params.id),v=_([]),l=le({name:"",type:"LLM",purpose:"inference",model_source:"local",description:"",path:"",api_url:"",api_key:"",online_model_name:""}),U={name:[{required:!0,message:"请输入模型名称",trigger:"blur"},{max:100,message:"不超过 100 字符",trigger:"blur"}],type:[{required:!0,message:"请选择模型类型",trigger:"change"}],purpose:[{required:!0,message:"请选择模型用途",trigger:"change"}]};function A(){return l.model_source==="local"?{path:[{required:!0,message:"请选择本地模型路径",trigger:"change"}]}:{api_url:[{required:!0,message:"请输入 API 地址",trigger:"blur"}],api_key:[{required:!0,message:"请输入 API Key",trigger:"blur"}],online_model_name:[{required:!0,message:"请输入模型名称",trigger:"blur"}]}}const R=Object.entries(X).map(([r,e])=>({value:r,label:e}));async function B(){if(d.value){c.value=!0;try{const r=await ne(d.value),e=r.model_source==="online"?"api":r.model_source||"local";Object.assign(l,{name:r.name||"",type:r.type||"LLM",purpose:r.purpose||"inference",model_source:e,description:r.description||"",path:r.path||"",api_url:r.api_url||"",api_key:r.api_key||"",online_model_name:r.model_name||""})}catch{}finally{c.value=!1}}}async function h(){try{const r=await se();v.value=(r==null?void 0:r.models)||[]}catch{v.value=[]}}async function O(){f.value&&await f.value.validate(async r=>{if(r){if(l.model_source==="local"&&!l.path){k.warning("请选择本地模型路径");return}g.value=!0;try{const e={name:l.name,type:l.type,purpose:l.purpose,model_source:l.model_source,description:l.description};l.model_source==="local"?e.path=l.path:(e.api_url=l.api_url,e.api_key=l.api_key,e.online_model_name=l.online_model_name),y.value&&d.value?(await ie(d.value,e),k.success("更新成功")):(await pe(e),k.success("创建成功")),M.push("/model-manage")}catch{}finally{g.value=!1}}})}function D(){M.back()}return Z(()=>{h(),B()}),(r,e)=>{const i=T,u=$,x=Y,q=z,p=J,C=H,V=G,K=F,N=j,S=Q;return ee((s(),m(ue,{title:y.value?"编辑模型":"添加模型"},{default:t(()=>[a(N,{ref_key:"formRef",ref:f,model:l,rules:{...U,...A()},"label-width":"120px",style:{"max-width":"640px"}},{default:t(()=>[a(u,{label:"模型名称",prop:"name"},{default:t(()=>[a(i,{modelValue:l.name,"onUpdate:modelValue":e[0]||(e[0]=o=>l.name=o),placeholder:"请输入模型名称",maxlength:"100","show-word-limit":""},null,8,["modelValue"])]),_:1}),a(u,{label:"模型类型",prop:"type"},{default:t(()=>[a(q,{modelValue:l.type,"onUpdate:modelValue":e[1]||(e[1]=o=>l.type=o),placeholder:"请选择模型类型",style:{width:"100%"}},{default:t(()=>[(s(!0),b(w,null,L(oe(R),o=>(s(),m(x,{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(u,{label:"模型用途",prop:"purpose"},{default:t(()=>[a(C,{modelValue:l.purpose,"onUpdate:modelValue":e[2]||(e[2]=o=>l.purpose=o)},{default:t(()=>[a(p,{value:"training"},{default:t(()=>[...e[9]||(e[9]=[n("训练基座",-1)])]),_:1}),a(p,{value:"inference"},{default:t(()=>[...e[10]||(e[10]=[n("推理对比",-1)])]),_:1}),a(p,{value:"evaluation"},{default:t(()=>[...e[11]||(e[11]=[n("评测",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(u,{label:"模型来源",prop:"model_source"},{default:t(()=>[a(C,{modelValue:l.model_source,"onUpdate:modelValue":e[3]||(e[3]=o=>l.model_source=o)},{default:t(()=>[a(p,{value:"local"},{default:t(()=>[...e[12]||(e[12]=[n("本地模型",-1)])]),_:1}),a(p,{value:"api"},{default:t(()=>[...e[13]||(e[13]=[n("在线模型",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l.model_source==="local"?(s(),m(u,{key:0,label:"本地模型路径",prop:"path"},{default:t(()=>[P("div",me,[a(q,{modelValue:l.path,"onUpdate:modelValue":e[4]||(e[4]=o=>l.path=o),placeholder:"请选择或输入 /data/yg-ft/models 下的模型路径",filterable:"","allow-create":"","default-first-option":"",clearable:"",style:{width:"100%"}},{default:t(()=>[(s(!0),b(w,null,L(v.value,o=>(s(),m(x,{key:o.path,label:`${o.name} (${o.path})${o.source?` - ${o.source}`:""}`,value:o.path},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),a(V,{onClick:h},{default:t(()=>[...e[14]||(e[14]=[n("刷新",-1)])]),_:1}),a(K,{content:"模型目录需要位于算力容器可访问路径,例如默认挂载目录 docker/compute/data/yg-ft/models 对应容器内 /data/yg-ft/models。浏览器不能把电脑任意本地目录直接作为训练路径。",placement:"top"},{default:t(()=>[...e[15]||(e[15]=[P("i",{class:"fa fa-info-circle model-path-help","aria-hidden":"true"},null,-1)])]),_:1})])]),_:1})):(s(),b(w,{key:1},[a(u,{label:"API 地址",prop:"api_url"},{default:t(()=>[a(i,{modelValue:l.api_url,"onUpdate:modelValue":e[5]||(e[5]=o=>l.api_url=o),placeholder:"如https://api.openai.com/v1"},null,8,["modelValue"])]),_:1}),a(u,{label:"API Key",prop:"api_key"},{default:t(()=>[a(i,{modelValue:l.api_key,"onUpdate:modelValue":e[6]||(e[6]=o=>l.api_key=o),type:"password","show-password":"",placeholder:"请输入 API Key"},null,8,["modelValue"])]),_:1}),a(u,{label:"模型名称",prop:"online_model_name"},{default:t(()=>[a(i,{modelValue:l.online_model_name,"onUpdate:modelValue":e[7]||(e[7]=o=>l.online_model_name=o),placeholder:"如gpt-4、qwen-turbo"},null,8,["modelValue"])]),_:1})],64)),a(u,{label:"模型描述"},{default:t(()=>[a(i,{modelValue:l.description,"onUpdate:modelValue":e[8]||(e[8]=o=>l.description=o),type:"textarea",rows:3,maxlength:"500","show-word-limit":"",placeholder:"选填"},null,8,["modelValue"])]),_:1}),a(u,null,{default:t(()=>[a(V,{type:"primary",loading:g.value,onClick:O},{default:t(()=>[n(ae(y.value?"保存":"创建"),1)]),_:1},8,["loading"]),a(V,{onClick:D},{default:t(()=>[...e[16]||(e[16]=[n("取消",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])),[[S,c.value]])}}}),Te=de(_e,[["__scopeId","data-v-6de511b8"]]);export{Te as default};