xinference 0.10.3__py3-none-any.whl → 0.11.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xinference might be problematic. Click here for more details.
- xinference/_version.py +3 -3
- xinference/api/oauth2/auth_service.py +1 -1
- xinference/api/restful_api.py +53 -61
- xinference/client/restful/restful_client.py +52 -57
- xinference/conftest.py +1 -1
- xinference/core/cache_tracker.py +1 -1
- xinference/core/chat_interface.py +10 -4
- xinference/core/event.py +1 -1
- xinference/core/model.py +17 -6
- xinference/core/status_guard.py +1 -1
- xinference/core/supervisor.py +58 -72
- xinference/core/worker.py +68 -101
- xinference/deploy/cmdline.py +166 -1
- xinference/deploy/test/test_cmdline.py +2 -0
- xinference/deploy/utils.py +1 -1
- xinference/device_utils.py +29 -3
- xinference/fields.py +7 -1
- xinference/model/audio/whisper.py +88 -12
- xinference/model/core.py +2 -2
- xinference/model/image/__init__.py +29 -0
- xinference/model/image/core.py +6 -0
- xinference/model/image/custom.py +109 -0
- xinference/model/llm/__init__.py +92 -32
- xinference/model/llm/core.py +57 -102
- xinference/model/llm/ggml/chatglm.py +98 -13
- xinference/model/llm/ggml/llamacpp.py +49 -2
- xinference/model/llm/ggml/tools/convert_ggml_to_gguf.py +2 -2
- xinference/model/llm/llm_family.json +438 -7
- xinference/model/llm/llm_family.py +45 -41
- xinference/model/llm/llm_family_modelscope.json +258 -5
- xinference/model/llm/pytorch/chatglm.py +48 -0
- xinference/model/llm/pytorch/core.py +23 -6
- xinference/model/llm/pytorch/deepseek_vl.py +115 -33
- xinference/model/llm/pytorch/internlm2.py +32 -1
- xinference/model/llm/pytorch/qwen_vl.py +94 -12
- xinference/model/llm/pytorch/utils.py +38 -1
- xinference/model/llm/pytorch/yi_vl.py +96 -51
- xinference/model/llm/sglang/core.py +31 -9
- xinference/model/llm/utils.py +54 -20
- xinference/model/llm/vllm/core.py +101 -7
- xinference/thirdparty/omnilmm/chat.py +2 -1
- xinference/thirdparty/omnilmm/model/omnilmm.py +2 -1
- xinference/types.py +11 -0
- xinference/web/ui/build/asset-manifest.json +6 -3
- xinference/web/ui/build/index.html +1 -1
- xinference/web/ui/build/static/css/main.54bca460.css +2 -0
- xinference/web/ui/build/static/css/main.54bca460.css.map +1 -0
- xinference/web/ui/build/static/js/main.551aa479.js +3 -0
- xinference/web/ui/build/static/js/{main.26fdbfbe.js.LICENSE.txt → main.551aa479.js.LICENSE.txt} +7 -0
- xinference/web/ui/build/static/js/main.551aa479.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/0b11a5339468c13b2d31ac085e7effe4303259b2071abd46a0a8eb8529233a5e.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/1fa824d82b2af519de7700c594e50bde4bbca60d13bd3fabff576802e4070304.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/23caf6f1e52c43e983ca3bfd4189f41dbd645fa78f2dfdcd7f6b69bc41678665.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/29dda700ab913cf7f2cfabe450ddabfb283e96adfa3ec9d315b2fa6c63cd375c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/2c63e940b945fd5817157e08a42b889b30d668ea4c91332f48ef2b1b9d26f520.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/4135fe8745434cbce6438d1ebfa47422e0c77d884db4edc75c8bf32ea1d50621.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/46b6dd1f6d1109cd0e2455a0ea0be3e9bda1097cd4ebec9c4040070372671cfc.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/4de0a71074f9cbe1e7862750dcdd08cbc1bae7d9d9849a78b1783ca670017b3c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/53f6c0c0afb51265cd8fb940daeb65523501879ac2a8c03a1ead22b9793c5041.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/8ccbb839002bc5bc03e0a0e7612362bf92f6ae64f87e094f8682d6a6fe4619bb.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/97ed30d6e22cf76f0733651e2c18364689a01665d0b5fe811c1b7ca3eb713c82.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/9c0c70f1838913aaa792a0d2260f17f90fd177b95698ed46b7bc3050eb712c1c.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/9cfd33238ca43e5bf9fc7e442690e8cc6027c73553db36de87e3597ed524ee4b.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/a6da6bc3d0d2191adebee87fb58ecebe82d071087bd2f7f3a9c7fdd2ada130f2.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/ada71518a429f821a9b1dea38bc951447f03c8db509887e0980b893acac938f3.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/b6c9558d28b5972bb8b2691c5a76a2c8814a815eb3443126da9f49f7d6a0c118.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/bb0f721c084a4d85c09201c984f02ee8437d3b6c5c38a57cb4a101f653daef1b.json +1 -0
- xinference/web/ui/node_modules/.package-lock.json +33 -0
- xinference/web/ui/node_modules/clipboard/.babelrc.json +11 -0
- xinference/web/ui/node_modules/clipboard/.eslintrc.json +24 -0
- xinference/web/ui/node_modules/clipboard/.prettierrc.json +9 -0
- xinference/web/ui/node_modules/clipboard/bower.json +18 -0
- xinference/web/ui/node_modules/clipboard/composer.json +25 -0
- xinference/web/ui/node_modules/clipboard/package.json +63 -0
- xinference/web/ui/node_modules/delegate/package.json +31 -0
- xinference/web/ui/node_modules/good-listener/bower.json +11 -0
- xinference/web/ui/node_modules/good-listener/package.json +35 -0
- xinference/web/ui/node_modules/select/bower.json +13 -0
- xinference/web/ui/node_modules/select/package.json +29 -0
- xinference/web/ui/node_modules/tiny-emitter/package.json +53 -0
- xinference/web/ui/package-lock.json +34 -0
- xinference/web/ui/package.json +1 -0
- {xinference-0.10.3.dist-info → xinference-0.11.1.dist-info}/METADATA +13 -12
- {xinference-0.10.3.dist-info → xinference-0.11.1.dist-info}/RECORD +88 -67
- xinference/client/oscar/__init__.py +0 -13
- xinference/client/oscar/actor_client.py +0 -611
- xinference/model/llm/pytorch/spec_decoding_utils.py +0 -531
- xinference/model/llm/pytorch/spec_model.py +0 -186
- xinference/web/ui/build/static/js/main.26fdbfbe.js +0 -3
- xinference/web/ui/build/static/js/main.26fdbfbe.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/1870cd6f7054d04e049e363c0a85526584fe25519378609d2838e28d7492bbf1.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/5393569d846332075b93b55656716a34f50e0a8c970be789502d7e6c49755fd7.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/63a4c48f0326d071c7772c46598215c006ae41fd3d4ff3577fe717de66ad6e89.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/de0299226173b0662b573f49e3992220f6611947073bd66ac079728a8bc8837d.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/e9b52d171223bb59fb918316297a051cdfd42dd453e8260fd918e90bc0a4ebdf.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/f4d5d1a41892a754c1ee0237450d804b20612d1b657945b59e564161ea47aa7a.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/fad4cd70de36ef6e6d5f8fd74a10ded58d964a8a91ef7681693fbb8376552da7.json +0 -1
- {xinference-0.10.3.dist-info → xinference-0.11.1.dist-info}/LICENSE +0 -0
- {xinference-0.10.3.dist-info → xinference-0.11.1.dist-info}/WHEEL +0 -0
- {xinference-0.10.3.dist-info → xinference-0.11.1.dist-info}/entry_points.txt +0 -0
- {xinference-0.10.3.dist-info → xinference-0.11.1.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,FormControl}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import HotkeyFocusTextField from'../../components/hotkeyFocusTextField';import ModelCard from'./modelCard';import style from'./styles/launchModelStyle';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchModelComponent=function LaunchModelComponent(_ref){var modelType=_ref.modelType;var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var handleChange=function handleChange(e){setSearchTerm(e.target.value);};var filter=function filter(registration){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';return modelName.includes(searchTerm.toLowerCase());};var update=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,registrations,builtinModels;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context.next=2;break;}return _context.abrupt(\"return\");case 2:_context.prev=2;setIsCallingApi(true);_context.next=6;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/\").concat(modelType,\"?detailed=true\"),{method:'GET'});case 6:response=_context.sent;_context.next=9;return response.json();case 9:registrations=_context.sent;builtinModels=registrations.filter(function(v){return v.is_builtin;});setRegistrationData(builtinModels);_context.next=17;break;case 14:_context.prev=14;_context.t0=_context[\"catch\"](2);console.error('Error:',_context.t0);case 17:_context.prev=17;setIsCallingApi(false);return _context.finish(17);case 20:case\"end\":return _context.stop();}},_callee,null,[[2,14,17,20]]);}));return function update(){return _ref2.apply(this,arguments);};}();useEffect(function(){update();},[]);return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for \".concat(modelType,\" model name\"),value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,modelType:modelType},filteredRegistration.model_name);})})]});};export default LaunchModelComponent;","map":{"version":3,"names":["Box","FormControl","React","useContext","useEffect","useState","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","style","jsx","_jsx","jsxs","_jsxs","LaunchModelComponent","_ref","modelType","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useState3","_useState4","searchTerm","setSearchTerm","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","handleChange","e","target","value","filter","registration","modelName","model_name","toLowerCase","includes","update","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","registrations","builtinModels","wrap","_callee$","_context","prev","next","abrupt","concat","method","sent","json","v","is_builtin","t0","console","error","finish","stop","apply","arguments","m","children","display","gridTemplateColumns","margin","variant","id","type","label","onChange","size","hotkey","map","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/LaunchModelComponent.js"],"sourcesContent":["import { Box, FormControl } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\nimport style from './styles/launchModelStyle'\n\nconst LaunchModelComponent = ({ modelType }) => {\n let endPoint = useContext(ApiContext).endPoint\n const [registrationData, setRegistrationData] = useState([])\n const [searchTerm, setSearchTerm] = useState('')\n\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n const handleChange = (e) => {\n setSearchTerm(e.target.value)\n }\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n return modelName.includes(searchTerm.toLowerCase())\n }\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return\n\n try {\n setIsCallingApi(true)\n\n const response = await fetcher(\n `${endPoint}/v1/model_registrations/${modelType}?detailed=true`,\n {\n method: 'GET',\n }\n )\n\n const registrations = await response.json()\n\n const builtinModels = registrations.filter((v) => {\n return v.is_builtin\n })\n setRegistrationData(builtinModels)\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [])\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label={`Search for ${modelType} model name`}\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n modelType={modelType}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchModelComponent\n"],"mappings":"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,QAAS,CACdoE,SAAS,CAAEF,oBAAqB,CAChCnE,SAAS,CAAEA,SAAU,EAHhBmE,oBAAoB,CAAC5C,UAI3B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAzB,oBAAoB"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Tab}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import Title from'../../components/Title';import LaunchCustom from'./launchCustom';import LaunchLLM from'./launchLLM';import LaunchModelComponent from'./LaunchModelComponent';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchModel=function LaunchModel(){var endPoint=useContext(ApiContext).endPoint;var _React$useState=React.useState(sessionStorage.getItem('modelType')?sessionStorage.getItem('modelType'):'/launch_model/llm'),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var _useState=useState(-1),_useState2=_slicedToArray(_useState,2),gpuAvailable=_useState2[0],setGPUAvailable=_useState2[1];var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);navigate(newValue);sessionStorage.setItem('modelType',newValue);newValue==='/launch_model/custom/llm'?sessionStorage.setItem('subType',newValue):'';};useEffect(function(){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token!=='no_auth'&&!sessionStorage.getItem('token')){navigate('/login',{replace:true});return;}if(gpuAvailable===-1){fetch(endPoint+'/v1/cluster/devices',{method:'GET',headers:{'Content-Type':'application/json'}}).then(function(res){if(!res.ok){// Usually, if some errors happen here, check if the cluster is available\nres.json().then(function(errorData){setErrorMsg(\"Server error: \".concat(res.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{res.json().then(function(data){setGPUAvailable(parseInt(data,10));});}});}},[cookie.token]);useEffect(function(){});return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Launch Model\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:value,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:value,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Models\",value:\"/launch_model/llm\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"/launch_model/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Models\",value:\"/launch_model/rerank\"}),/*#__PURE__*/_jsx(Tab,{label:\"Image Models\",value:\"/launch_model/image\"}),/*#__PURE__*/_jsx(Tab,{label:\"Audio Models\",value:\"/launch_model/audio\"}),/*#__PURE__*/_jsx(Tab,{label:\"Custom Models\",value:\"/launch_model/custom/llm\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchLLM,{gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/embedding\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'embedding'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'rerank'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/image\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'image'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/audio\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'audio'})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/custom/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchCustom,{gpuAvailable:gpuAvailable})})]})]});};export default LaunchModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","Title","LaunchCustom","LaunchLLM","LaunchModelComponent","jsx","_jsx","jsxs","_jsxs","LaunchModel","endPoint","_React$useState","sessionStorage","getItem","_React$useState2","_slicedToArray","value","setValue","_useState","_useState2","gpuAvailable","setGPUAvailable","_useContext","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","handleTabChange","event","newValue","setItem","token","undefined","replace","fetch","method","headers","then","res","ok","json","errorData","concat","status","detail","data","parseInt","m","children","title","sx","borderBottom","borderColor","onChange","label","padding","modelType"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Tab } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport Title from '../../components/Title'\nimport LaunchCustom from './launchCustom'\nimport LaunchLLM from './launchLLM'\nimport LaunchModelComponent from './LaunchModelComponent'\n\nconst LaunchModel = () => {\n let endPoint = useContext(ApiContext).endPoint\n const [value, setValue] = React.useState(\n sessionStorage.getItem('modelType')\n ? sessionStorage.getItem('modelType')\n : '/launch_model/llm'\n )\n const [gpuAvailable, setGPUAvailable] = useState(-1)\n\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('modelType', newValue)\n newValue === '/launch_model/custom/llm'\n ? sessionStorage.setItem('subType', newValue)\n : ''\n }\n\n useEffect(() => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token !== 'no_auth' && !sessionStorage.getItem('token')) {\n navigate('/login', { replace: true })\n return\n }\n\n if (gpuAvailable === -1) {\n fetch(endPoint + '/v1/cluster/devices', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((res) => {\n if (!res.ok) {\n // Usually, if some errors happen here, check if the cluster is available\n res.json().then((errorData) => {\n setErrorMsg(\n `Server error: ${res.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n res.json().then((data) => {\n setGPUAvailable(parseInt(data, 10))\n })\n }\n })\n }\n }, [cookie.token])\n\n useEffect(() => {})\n return (\n <Box m=\"20px\">\n <Title title=\"Launch Model\" />\n <ErrorMessageSnackBar />\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label=\"Language Models\" value=\"/launch_model/llm\" />\n <Tab label=\"Embedding Models\" value=\"/launch_model/embedding\" />\n <Tab label=\"Rerank Models\" value=\"/launch_model/rerank\" />\n <Tab label=\"Image Models\" value=\"/launch_model/image\" />\n <Tab label=\"Audio Models\" value=\"/launch_model/audio\" />\n <Tab label=\"Custom Models\" value=\"/launch_model/custom/llm\" />\n </TabList>\n </Box>\n <TabPanel value=\"/launch_model/llm\" sx={{ padding: 0 }}>\n <LaunchLLM gpuAvailable={gpuAvailable} />\n </TabPanel>\n <TabPanel value=\"/launch_model/embedding\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'embedding'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/rerank\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'rerank'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/image\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'image'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/audio\" sx={{ padding: 0 }}>\n <LaunchModelComponent modelType={'audio'} />\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/llm\" sx={{ padding: 0 }}>\n <LaunchCustom gpuAvailable={gpuAvailable} />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default LaunchModel\n"],"mappings":"6IAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,GAAG,KAAQ,eAAe,CACxC,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,MAAO,CAAAC,YAAY,KAAM,gBAAgB,CACzC,MAAO,CAAAC,SAAS,KAAM,aAAa,CACnC,MAAO,CAAAC,oBAAoB,KAAM,wBAAwB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEzD,GAAM,CAAAC,WAAW,CAAG,QAAd,CAAAA,WAAWA,CAAA,CAAS,CACxB,GAAI,CAAAC,QAAQ,CAAGhB,UAAU,CAACK,UAAU,CAAC,CAACW,QAAQ,CAC9C,IAAAC,eAAA,CAA0BlB,KAAK,CAACG,QAAQ,CACtCgB,cAAc,CAACC,OAAO,CAAC,WAAW,CAAC,CAC/BD,cAAc,CAACC,OAAO,CAAC,WAAW,CAAC,CACnC,mBACN,CAAC,CAAAC,gBAAA,CAAAC,cAAA,CAAAJ,eAAA,IAJMK,KAAK,CAAAF,gBAAA,IAAEG,Q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E,CAAC,CACpC,CAAC,cACXnD,IAAA,CAAChB,QAAQ,EAAC0B,KAAK,CAAC,qBAAqB,CAACmC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACvD3C,IAAA,CAACF,oBAAoB,EAACqD,SAAS,CAAE,OAAQ,CAAE,CAAC,CACpC,CAAC,cACXnD,IAAA,CAAChB,QAAQ,EAAC0B,KAAK,CAAC,0BAA0B,CAACmC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cAC5D3C,IAAA,CAACJ,YAAY,EAACkB,YAAY,CAAEA,YAAa,CAAE,CAAC,CACpC,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAX,WAAW"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Checkbox,FormControl,FormControlLabel}from'@mui/material';import Alert from'@mui/material/Alert';import AlertTitle from'@mui/material/AlertTitle';import Button from'@mui/material/Button';import TextField from'@mui/material/TextField';import React,{useContext,useState}from'react';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import{useMode}from'../../theme';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:'English',zh:'Chinese'};// Convert dictionary of supported languages into list\nvar SUPPORTED_LANGUAGES=Object.keys(SUPPORTED_LANGUAGES_DICT);var RegisterRerankModel=function RegisterRerankModel(){var ERROR_COLOR=useMode();var endPoint=useContext(ApiContext).endPoint;var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),successMsg=_useState2[0],setSuccessMsg=_useState2[1];var navigate=useNavigate();var _useState3=useState({model_name:'custom-rerank',language:['en'],model_uri:'/path/to/rerank-model'}),_useState4=_slicedToArray(_useState3,2),formData=_useState4[0],setFormData=_useState4[1];var errorModelName=formData.model_name.trim().length<=0;var errorLanguage=formData.language===undefined||formData.language.length===0;var handleClick=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var errorAny,response,errorData;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:errorAny=errorModelName||errorLanguage;if(!errorAny){_context.next=4;break;}setErrorMsg('Please fill in valid value for all fields');return _context.abrupt(\"return\");case 4:_context.prev=4;_context.next=7;return fetcher(endPoint+'/v1/model_registrations/rerank',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 7:response=_context.sent;if(response.ok){_context.next=15;break;}_context.next=11;return response.json();case 11:errorData=_context.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context.next=19;break;case 15:setSuccessMsg('Model has been registered successfully! Navigate to launch model page to proceed.');navigate('/launch_model/custom/rerank');sessionStorage.setItem('modelType','/launch_model/custom/llm');sessionStorage.setItem('subType','/launch_model/custom/rerank');case 19:_context.next=25;break;case 21:_context.prev=21;_context.t0=_context[\"catch\"](4);console.error('There was a problem with the fetch operation:',_context.t0);setErrorMsg(_context.t0.message||'An unexpected error occurred.');case 25:case\"end\":return _context.stop();}},_callee,null,[[4,21]]);}));return function handleClick(){return _ref.apply(this,arguments);};}();var toggleLanguage=function toggleLanguage(lang){if(formData.language.includes(lang)){setFormData(_objectSpread(_objectSpread({},formData),{},{language:formData.language.filter(function(l){return l!==lang;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{language:[].concat(_toConsumableArray(formData.language),[lang])}));}};return/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsx(Box,{padding:\"20px\"}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(TextField,{label:\"Model Name\",error:errorModelName,defaultValue:formData.model_name,size:\"small\",helperText:\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_name:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Path\",size:\"small\",value:formData.model_uri,onChange:function onChange(e){setFormData(_objectSpread(_objectSpread({},formData),{},{model_uri:e.target.value}));},helperText:\"Provide the model directory path.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorLanguage?ERROR_COLOR:'inherit'},children:\"Model Languages\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_LANGUAGES.map(function(lang){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.language.includes(lang),onChange:function onChange(){return toggleLanguage(lang);},name:lang,sx:errorLanguage?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:SUPPORTED_LANGUAGES_DICT[lang],style:{paddingLeft:10,color:errorLanguage?ERROR_COLOR:'inherit'}})},lang);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(Box,{width:'100%',children:[successMsg!==''&&/*#__PURE__*/_jsxs(Alert,{severity:\"success\",children:[/*#__PURE__*/_jsx(AlertTitle,{children:\"Success\"}),successMsg]}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]});};export default RegisterRerankModel;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',maxWidth:'80%'},labelPaddingLeft:{paddingLeft:5},formControlLabelPaddingLeft:{paddingLeft:10},buttonBox:{width:'100%',margin:'20px'},error:{fontWeight:'bold',margin:'5px 0',padding:'1px',borderRadius:'5px'}};","map":{"version":3,"names":["Box","Checkbox","FormControl","FormControlLabel","Alert","AlertTitle","Button","TextField","React","useContext","useState","useNavigate","ApiContext","fetcher","useMode","jsx","_jsx","jsxs","_jsxs","SUPPORTED_LANGUAGES_DICT","en","zh","SUPPORTED_LANGUAGES","Object","keys","RegisterRerankModel","ERROR_COLOR","endPoint","_useContext","setErrorMsg","_useState","_useState2","_slicedToArray","successMsg","setSuccessMsg","navigate","_useState3","model_name","language","model_uri","_useState4","formData","setFormData","errorModelName","trim","length","errorLanguage","undefined","handleClick","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","errorAny","response","errorData","wrap","_callee$","_context","prev","next","abrupt","method","headers","body","JSON","stringify","model","persist","sent","ok","json","concat","status","detail","sessionStorage","setItem","t0","console","error","message","stop","apply","arguments","toggleLanguage","lang","includes","_objectSpread","filter","l","_toConsumableArray","Fragment","children","padding","sx","styles","baseFormControl","label","defaultValue","size","helperText","onChange","event","target","value","e","style","paddingLeft","color","checkboxWrapper","map","marginRight","control","checked","name","width","severity","variant","type","onClick","margin","display","flexWrap","maxWidth","labelPaddingLeft","formControlLabelPaddingLeft","buttonBox","fontWeight","borderRadius"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/register_rerank.js"],"sourcesContent":["import { Box, Checkbox, FormControl, FormControlLabel } from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport AlertTitle from '@mui/material/AlertTitle'\nimport Button from '@mui/material/Button'\nimport TextField from '@mui/material/TextField'\nimport React, { useContext, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport { useMode } from '../../theme'\n\nconst SUPPORTED_LANGUAGES_DICT = { en: 'English', zh: 'Chinese' }\n// Convert dictionary of supported languages into list\nconst SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT)\n\nconst RegisterRerankModel = () => {\n const ERROR_COLOR = useMode()\n const endPoint = useContext(ApiContext).endPoint\n const { setErrorMsg } = useContext(ApiContext)\n const [successMsg, setSuccessMsg] = useState('')\n const navigate = useNavigate()\n const [formData, setFormData] = useState({\n model_name: 'custom-rerank',\n language: ['en'],\n model_uri: '/path/to/rerank-model',\n })\n\n const errorModelName = formData.model_name.trim().length <= 0\n const errorLanguage =\n formData.language === undefined || formData.language.length === 0\n\n const handleClick = async () => {\n const errorAny = errorModelName || errorLanguage\n\n if (errorAny) {\n setErrorMsg('Please fill in valid value for all fields')\n return\n }\n\n try {\n const response = await fetcher(\n endPoint + '/v1/model_registrations/rerank',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: JSON.stringify(formData),\n persist: true,\n }),\n }\n )\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n setSuccessMsg(\n 'Model has been registered successfully! Navigate to launch model page to proceed.'\n )\n navigate('/launch_model/custom/rerank')\n sessionStorage.setItem('modelType', '/launch_model/custom/llm')\n sessionStorage.setItem('subType', '/launch_model/custom/rerank')\n }\n } catch (error) {\n console.error('There was a problem with the fetch operation:', error)\n setErrorMsg(error.message || 'An unexpected error occurred.')\n }\n }\n\n const toggleLanguage = (lang) => {\n if (formData.language.includes(lang)) {\n setFormData({\n ...formData,\n language: formData.language.filter((l) => l !== lang),\n })\n } else {\n setFormData({\n ...formData,\n language: [...formData.language, lang],\n })\n }\n }\n\n return (\n <React.Fragment>\n <Box padding=\"20px\"></Box>\n {/* Base Information */}\n <FormControl sx={styles.baseFormControl}>\n <TextField\n label=\"Model Name\"\n error={errorModelName}\n defaultValue={formData.model_name}\n size=\"small\"\n helperText=\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\"\n onChange={(event) =>\n setFormData({ ...formData, model_name: event.target.value })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Path\"\n size=\"small\"\n value={formData.model_uri}\n onChange={(e) => {\n setFormData({\n ...formData,\n model_uri: e.target.value,\n })\n }}\n helperText=\"Provide the model directory path.\"\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Languages\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_LANGUAGES.map((lang) => (\n <Box key={lang} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.language.includes(lang)}\n onChange={() => toggleLanguage(lang)}\n name={lang}\n sx={\n errorLanguage\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={SUPPORTED_LANGUAGES_DICT[lang]}\n style={{\n paddingLeft: 10,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <Box width={'100%'}>\n {successMsg !== '' && (\n <Alert severity=\"success\">\n <AlertTitle>Success</AlertTitle>\n {successMsg}\n </Alert>\n )}\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleClick}\n >\n Register Model\n </Button>\n </Box>\n </React.Fragment>\n )\n}\n\nexport default RegisterRerankModel\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n maxWidth: '80%',\n },\n labelPaddingLeft: {\n paddingLeft: 5,\n },\n formControlLabelPaddingLeft: {\n paddingLeft: 10,\n },\n buttonBox: {\n width: '100%',\n margin: '20px',\n },\n error: {\n fontWeight: 'bold',\n margin: '5px 0',\n padding: '1px',\n borderRadius: '5px',\n },\n}\n"],"mappings":"wtBAAA,OAASA,GAAG,CAAEC,QAAQ,CAAEC,WAAW,CAAEC,gBAAgB,KAAQ,eAAe,CAC5E,MAAO,CAAAC,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,MAAM,KAAM,sBAAsB,CACzC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,QAAQ,KAAQ,OAAO,CACnD,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,OAASC,OAAO,KAAQ,aAAa,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAErC,GAAM,CAAAC,wBAAwB,CAAG,CAAEC,EAAE,CAAE,SAAS,CAAEC,EAAE,CAAE,SAAU,CAAC,CACjE;AACA,GAAM,CAAAC,mBAAmB,CAAGC,MAAM,CAACC,IAAI,CAACL,wBAAwB,CAAC,CAEjE,GAAM,CAAAM,mBAAmB,CAAG,QAAtB,CAAAA,mBAAmBA,CAAA,CAAS,CAChC,GAAM,CAAAC,WAAW,CAAGZ,OAAO,CAAC,CAAC,CAC7B,GAAM,CAAAa,QAAQ,CAAGlB,UAAU,CAACG,UAAU,CAAC,CAACe,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BM4D,IAyBL,CAAC,EACP,CAAC,CACC,CAAC,cACNtE,IAAA,CAAChB,GAAG,EAAC8F,OAAO,CAAC,MAAM,CAAM,CAAC,EACf,CAAC,cAEd5E,KAAA,CAAClB,GAAG,EAACoH,KAAK,CAAE,MAAO,CAAAvB,QAAA,EAChB5D,UAAU,GAAK,EAAE,eAChBf,KAAA,CAACd,KAAK,EAACiH,QAAQ,CAAC,SAAS,CAAAxB,QAAA,eACvB7E,IAAA,CAACX,UAAU,EAAAwF,QAAA,CAAC,SAAO,CAAY,CAAC,CAC/B5D,UAAU,EACN,CACR,cACDjB,IAAA,CAACV,MAAM,EACLgH,OAAO,CAAC,WAAW,CACnBT,KAAK,CAAC,SAAS,CACfU,IAAI,CAAC,QAAQ,CACbC,OAAO,CAAExE,WAAY,CAAA6C,QAAA,CACtB,gBAED,CAAQ,CAAC,EACN,CAAC,EACQ,CAAC,CAErB,CAAC,CAED,cAAe,CAAApE,mBAAmB,CAElC,GAAM,CAAAuE,MAAM,CAAG,CACbC,eAAe,CAAE,CACfmB,KAAK,CAAE,MAAM,CACbK,MAAM,CAAE,QAAQ,CAChBrB,IAAI,CAAE,OACR,CAAC,CACDU,eAAe,CAAE,CACfY,OAAO,CAAE,MAAM,CACfC,QAAQ,CAAE,MAAM,CAChBC,QAAQ,CAAE,KACZ,CAAC,CACDC,gBAAgB,CAAE,CAChBjB,WAAW,CAAE,CACf,CAAC,CACDkB,2BAA2B,CAAE,CAC3BlB,WAAW,CAAE,EACf,CAAC,CACDmB,SAAS,CAAE,CACTX,KAAK,CAAE,MAAM,CACbK,MAAM,CAAE,MACV,CAAC,CACDzC,KAAK,CAAE,CACLgD,UAAU,CAAE,MAAM,CAClBP,MAAM,CAAE,OAAO,CACf3B,OAAO,CAAE,KAAK,CACdmC,YAAY,CAAE,KAChB,CACF,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Checkbox,FormControl,FormControlLabel}from'@mui/material';import Alert from'@mui/material/Alert';import AlertTitle from'@mui/material/AlertTitle';import Button from'@mui/material/Button';import TextField from'@mui/material/TextField';import React,{useContext,useState}from'react';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import{useMode}from'../../theme';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:'English',zh:'Chinese'};// Convert dictionary of supported languages into list\nvar SUPPORTED_LANGUAGES=Object.keys(SUPPORTED_LANGUAGES_DICT);var RegisterEmbeddingModel=function RegisterEmbeddingModel(){var ERROR_COLOR=useMode();var endPoint=useContext(ApiContext).endPoint;var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),successMsg=_useState2[0],setSuccessMsg=_useState2[1];var navigate=useNavigate();var _useState3=useState({model_name:'custom-embedding',dimensions:768,max_tokens:512,language:['en'],model_uri:'/path/to/embedding-model'}),_useState4=_slicedToArray(_useState3,2),formData=_useState4[0],setFormData=_useState4[1];var errorModelName=formData.model_name.trim().length<=0;var errorDimensions=formData.dimensions<0;var errorMaxTokens=formData.max_tokens<0;var errorLanguage=formData.language===undefined||formData.language.length===0;var handleClick=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var errorAny,response,errorData;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:errorAny=errorModelName||errorDimensions||errorMaxTokens||errorLanguage;if(!errorAny){_context.next=4;break;}setErrorMsg('Please fill in valid value for all fields');return _context.abrupt(\"return\");case 4:_context.prev=4;_context.next=7;return fetcher(endPoint+'/v1/model_registrations/embedding',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 7:response=_context.sent;if(response.ok){_context.next=15;break;}_context.next=11;return response.json();case 11:errorData=_context.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context.next=19;break;case 15:setSuccessMsg('Model has been registered successfully! Navigate to launch model page to proceed.');navigate('/launch_model/custom/embedding');sessionStorage.setItem('modelType','/launch_model/custom/llm');sessionStorage.setItem('subType','/launch_model/custom/embedding');case 19:_context.next=25;break;case 21:_context.prev=21;_context.t0=_context[\"catch\"](4);console.error('There was a problem with the fetch operation:',_context.t0);setErrorMsg(_context.t0.message||'An unexpected error occurred.');case 25:case\"end\":return _context.stop();}},_callee,null,[[4,21]]);}));return function handleClick(){return _ref.apply(this,arguments);};}();var toggleLanguage=function toggleLanguage(lang){if(formData.language.includes(lang)){setFormData(_objectSpread(_objectSpread({},formData),{},{language:formData.language.filter(function(l){return l!==lang;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{language:[].concat(_toConsumableArray(formData.language),[lang])}));}};return/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsx(Box,{padding:\"20px\"}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(TextField,{label:\"Model Name\",error:errorModelName,defaultValue:formData.model_name,size:\"small\",helperText:\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_name:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:errorDimensions,label:\"Dimensions\",value:formData.dimensions,size:\"small\",onChange:function onChange(event){setFormData(_objectSpread(_objectSpread({},formData),{},{dimensions:parseInt(event.target.value,10)}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:errorMaxTokens,label:\"Max Tokens\",value:formData.max_tokens,size:\"small\",onChange:function onChange(event){setFormData(_objectSpread(_objectSpread({},formData),{},{max_tokens:parseInt(event.target.value,10)}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Path\",size:\"small\",value:formData.model_uri,onChange:function onChange(e){setFormData(_objectSpread(_objectSpread({},formData),{},{model_uri:e.target.value}));},helperText:\"Provide the model directory path.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorLanguage?ERROR_COLOR:'inherit'},children:\"Model Languages\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_LANGUAGES.map(function(lang){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.language.includes(lang),onChange:function onChange(){return toggleLanguage(lang);},name:lang,sx:errorLanguage?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:SUPPORTED_LANGUAGES_DICT[lang],style:{paddingLeft:10,color:errorLanguage?ERROR_COLOR:'inherit'}})},lang);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(Box,{width:'100%',children:[successMsg!==''&&/*#__PURE__*/_jsxs(Alert,{severity:\"success\",children:[/*#__PURE__*/_jsx(AlertTitle,{children:\"Success\"}),successMsg]}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]});};export default RegisterEmbeddingModel;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',maxWidth:'80%'},labelPaddingLeft:{paddingLeft:5},formControlLabelPaddingLeft:{paddingLeft:10},buttonBox:{width:'100%',margin:'20px'},error:{fontWeight:'bold',margin:'5px 0',padding:'1px',borderRadius:'5px'}};","map":{"version":3,"names":["Box","Checkbox","FormControl","FormControlLabel","Alert","AlertTitle","Button","TextField","React","useContext","useState","useNavigate","ApiContext","fetcher","useMode","jsx","_jsx","jsxs","_jsxs","SUPPORTED_LANGUAGES_DICT","en","zh","SUPPORTED_LANGUAGES","Object","keys","RegisterEmbeddingModel","ERROR_COLOR","endPoint","_useContext","setErrorMsg","_useState","_useState2","_slicedToArray","successMsg","setSuccessMsg","navigate","_useState3","model_name","dimensions","max_tokens","language","model_uri","_useState4","formData","setFormData","errorModelName","trim","length","errorDimensions","errorMaxTokens","errorLanguage","undefined","handleClick","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","errorAny","response","errorData","wrap","_callee$","_context","prev","next","abrupt","method","headers","body","JSON","stringify","model","persist","sent","ok","json","concat","status","detail","sessionStorage","setItem","t0","console","error","message","stop","apply","arguments","toggleLanguage","lang","includes","_objectSpread","filter","l","_toConsumableArray","Fragment","children","padding","sx","styles","baseFormControl","label","defaultValue","size","helperText","onChange","event","target","value","parseInt","e","style","paddingLeft","color","checkboxWrapper","map","marginRight","control","checked","name","width","severity","variant","type","onClick","margin","display","flexWrap","maxWidth","labelPaddingLeft","formControlLabelPaddingLeft","buttonBox","fontWeight","borderRadius"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/register_embedding.js"],"sourcesContent":["import { Box, Checkbox, FormControl, FormControlLabel } from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport AlertTitle from '@mui/material/AlertTitle'\nimport Button from '@mui/material/Button'\nimport TextField from '@mui/material/TextField'\nimport React, { useContext, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport { useMode } from '../../theme'\n\nconst SUPPORTED_LANGUAGES_DICT = { en: 'English', zh: 'Chinese' }\n// Convert dictionary of supported languages into list\nconst SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT)\n\nconst RegisterEmbeddingModel = () => {\n const ERROR_COLOR = useMode()\n const endPoint = useContext(ApiContext).endPoint\n const { setErrorMsg } = useContext(ApiContext)\n const [successMsg, setSuccessMsg] = useState('')\n const navigate = useNavigate()\n const [formData, setFormData] = useState({\n model_name: 'custom-embedding',\n dimensions: 768,\n max_tokens: 512,\n language: ['en'],\n model_uri: '/path/to/embedding-model',\n })\n\n const errorModelName = formData.model_name.trim().length <= 0\n const errorDimensions = formData.dimensions < 0\n const errorMaxTokens = formData.max_tokens < 0\n const errorLanguage =\n formData.language === undefined || formData.language.length === 0\n\n const handleClick = async () => {\n const errorAny =\n errorModelName || errorDimensions || errorMaxTokens || errorLanguage\n\n if (errorAny) {\n setErrorMsg('Please fill in valid value for all fields')\n return\n }\n\n try {\n const response = await fetcher(\n endPoint + '/v1/model_registrations/embedding',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: JSON.stringify(formData),\n persist: true,\n }),\n }\n )\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n setSuccessMsg(\n 'Model has been registered successfully! Navigate to launch model page to proceed.'\n )\n navigate('/launch_model/custom/embedding')\n sessionStorage.setItem('modelType', '/launch_model/custom/llm')\n sessionStorage.setItem('subType', '/launch_model/custom/embedding')\n }\n } catch (error) {\n console.error('There was a problem with the fetch operation:', error)\n setErrorMsg(error.message || 'An unexpected error occurred.')\n }\n }\n\n const toggleLanguage = (lang) => {\n if (formData.language.includes(lang)) {\n setFormData({\n ...formData,\n language: formData.language.filter((l) => l !== lang),\n })\n } else {\n setFormData({\n ...formData,\n language: [...formData.language, lang],\n })\n }\n }\n\n return (\n <React.Fragment>\n <Box padding=\"20px\"></Box>\n {/* Base Information */}\n <FormControl sx={styles.baseFormControl}>\n <TextField\n label=\"Model Name\"\n error={errorModelName}\n defaultValue={formData.model_name}\n size=\"small\"\n helperText=\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\"\n onChange={(event) =>\n setFormData({ ...formData, model_name: event.target.value })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={errorDimensions}\n label=\"Dimensions\"\n value={formData.dimensions}\n size=\"small\"\n onChange={(event) => {\n setFormData({\n ...formData,\n dimensions: parseInt(event.target.value, 10),\n })\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={errorMaxTokens}\n label=\"Max Tokens\"\n value={formData.max_tokens}\n size=\"small\"\n onChange={(event) => {\n setFormData({\n ...formData,\n max_tokens: parseInt(event.target.value, 10),\n })\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Path\"\n size=\"small\"\n value={formData.model_uri}\n onChange={(e) => {\n setFormData({\n ...formData,\n model_uri: e.target.value,\n })\n }}\n helperText=\"Provide the model directory path.\"\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Languages\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_LANGUAGES.map((lang) => (\n <Box key={lang} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.language.includes(lang)}\n onChange={() => toggleLanguage(lang)}\n name={lang}\n sx={\n errorLanguage\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={SUPPORTED_LANGUAGES_DICT[lang]}\n style={{\n paddingLeft: 10,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <Box width={'100%'}>\n {successMsg !== '' && (\n <Alert severity=\"success\">\n <AlertTitle>Success</AlertTitle>\n {successMsg}\n </Alert>\n )}\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleClick}\n >\n Register Model\n </Button>\n </Box>\n </React.Fragment>\n )\n}\n\nexport default RegisterEmbeddingModel\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n maxWidth: '80%',\n },\n labelPaddingLeft: {\n paddingLeft: 5,\n },\n formControlLabelPaddingLeft: {\n paddingLeft: 10,\n },\n buttonBox: {\n width: '100%',\n margin: '20px',\n },\n error: {\n fontWeight: 'bold',\n margin: '5px 0',\n padding: '1px',\n borderRadius: '5px',\n },\n}\n"],"mappings":"wtBAAA,OAASA,GAAG,CAAEC,QAAQ,CAAEC,WAAW,CAAEC,gBAAgB,KAAQ,eAAe,CAC5E,MAAO,CAAAC,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,MAAM,KAAM,sBAAsB,CACzC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,QAAQ,KAAQ,OAAO,CACnD,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,OAASC,OAAO,KAAQ,aAAa,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAErC,GAAM,CAAA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CAAE,OAAO,CACf5B,OAAO,CAAE,KAAK,CACdoC,YAAY,CAAE,KAChB,CACF,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Checkbox,FormControl,FormControlLabel,FormHelperText,Radio,RadioGroup,Tab}from'@mui/material';import Alert from'@mui/material/Alert';import AlertTitle from'@mui/material/AlertTitle';import Button from'@mui/material/Button';import TextField from'@mui/material/TextField';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetcher from'../../components/fetcher';import Title from'../../components/Title';import{useMode}from'../../theme';import RegisterEmbeddingModel from'./register_embedding';import RegisterRerankModel from'./register_rerank';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:'English',zh:'Chinese'};var SUPPORTED_FEATURES=['Generate','Chat'];// Convert dictionary of supported languages into list\nvar SUPPORTED_LANGUAGES=Object.keys(SUPPORTED_LANGUAGES_DICT);var RegisterModel=function RegisterModel(){var ERROR_COLOR=useMode();var endPoint=useContext(ApiContext).endPoint;var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),successMsg=_useState2[0],setSuccessMsg=_useState2[1];var _useState3=useState('pytorch'),_useState4=_slicedToArray(_useState3,2),modelFormat=_useState4[0],setModelFormat=_useState4[1];var _useState5=useState(7),_useState6=_slicedToArray(_useState5,2),modelSize=_useState6[0],setModelSize=_useState6[1];var _useState7=useState('/path/to/llama-2'),_useState8=_slicedToArray(_useState7,2),modelUri=_useState8[0],setModelUri=_useState8[1];var _useState9=useState(''),_useState10=_slicedToArray(_useState9,2),quantization=_useState10[0],setQuantization=_useState10[1];var _useState11=useState({version:1,context_length:2048,model_name:'custom-llama-2',model_lang:['en'],model_ability:['generate'],model_description:'This is a custom model description.',model_family:'',model_specs:[],prompt_style:undefined}),_useState12=_slicedToArray(_useState11,2),formData=_useState12[0],setFormData=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),promptStyles=_useState14[0],setPromptStyles=_useState14[1];var _useState15=useState({chat:[],generate:[]}),_useState16=_slicedToArray(_useState15,2),family=_useState16[0],setFamily=_useState16[1];var _useState17=useState(''),_useState18=_slicedToArray(_useState17,2),familyLabel=_useState18[0],setFamilyLabel=_useState18[1];var _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var errorModelName=formData.model_name.trim().length<=0;var errorModelDescription=formData.model_description.length<0;var errorContextLength=formData.context_length===0;var errorLanguage=formData.model_lang===undefined||formData.model_lang.length===0;var errorAbility=formData.model_ability===undefined||formData.model_ability.length===0;var errorModelSize=formData.model_specs&&formData.model_specs.some(function(spec){return spec.model_size_in_billions===undefined||spec.model_size_in_billions===0;});var errorFamily=familyLabel==='';var errorAny=errorModelName||errorModelDescription||errorContextLength||errorLanguage||errorAbility||errorModelSize||errorFamily;useEffect(function(){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token!=='no_auth'&&!sessionStorage.getItem('token')){navigate('/login',{replace:true});return;}var getBuiltinFamilies=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,errorData,data;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(endPoint+'/v1/models/families',{method:'GET',headers:{'Content-Type':'application/json'}});case 2:response=_context.sent;if(response.ok){_context.next=10;break;}_context.next=6;return response.json();case 6:errorData=_context.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context.next=16;break;case 10:_context.next=12;return response.json();case 12:data=_context.sent;data.chat.push('other');data.generate.push('other');setFamily(data);case 16:case\"end\":return _context.stop();}},_callee);}));return function getBuiltinFamilies(){return _ref.apply(this,arguments);};}();var getBuiltInPromptStyles=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var response,errorData,data,res,key,v;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return fetch(endPoint+'/v1/models/prompts',{method:'GET',headers:{'Content-Type':'application/json'}});case 2:response=_context2.sent;if(response.ok){_context2.next=10;break;}_context2.next=6;return response.json();case 6:errorData=_context2.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context2.next=16;break;case 10:_context2.next=12;return response.json();case 12:data=_context2.sent;res=[];for(key in data){v=data[key];v['name']=key;res.push(v);}setPromptStyles(res);case 16:case\"end\":return _context2.stop();}},_callee2);}));return function getBuiltInPromptStyles(){return _ref2.apply(this,arguments);};}();// avoid keep requesting backend to get prompts\nif(promptStyles.length===0){getBuiltInPromptStyles().catch(function(error){setErrorMsg(error.message||'An unexpected error occurred when getting builtin prompt styles.');console.error('Error: ',error);});}if(family.chat.length===0){getBuiltinFamilies().catch(function(error){setErrorMsg(error.message||'An unexpected error occurred when getting builtin prompt styles.');console.error('Error: ',error);});}},[cookie.token]);var getFamilyByAbility=function getFamilyByAbility(){if(formData.model_ability.includes('chat')){return family.chat;}else{return family.generate;}};var isModelFormatPytorch=function isModelFormatPytorch(){return modelFormat==='pytorch';};var isModelFormatGPTQ=function isModelFormatGPTQ(){return modelFormat==='gptq';};var isModelFormatAWQ=function isModelFormatAWQ(){return modelFormat==='awq';};var getPathComponents=function getPathComponents(path){var normalizedPath=path.replace(/\\\\/g,'/');var baseDir=normalizedPath.substring(0,normalizedPath.lastIndexOf('/'));var filename=normalizedPath.substring(normalizedPath.lastIndexOf('/')+1);return{baseDir:baseDir,filename:filename};};var handleClick=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _getPathComponents,baseDir,filename,ps,_ps$stop,_ps$stop_token_ids,response,errorData;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(isModelFormatGPTQ()){formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[quantization],model_id:'',model_uri:modelUri}];}else if(isModelFormatAWQ()){formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[quantization],model_id:'',model_uri:modelUri}];}else if(!isModelFormatPytorch()){_getPathComponents=getPathComponents(modelUri),baseDir=_getPathComponents.baseDir,filename=_getPathComponents.filename;formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[quantization],model_id:'',model_file_name_template:filename,model_uri:baseDir}];}else{formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:['4-bit','8-bit','none'],model_id:'',model_uri:modelUri}];}formData.model_family=familyLabel;if(formData.model_ability.includes('chat')){ps=promptStyles.find(function(item){return item.name===familyLabel;});if(ps){formData.prompt_style={style_name:ps.style_name,system_prompt:ps.system_prompt,roles:ps.roles,intra_message_sep:ps.intra_message_sep,inter_message_sep:ps.inter_message_sep,stop:(_ps$stop=ps.stop)!==null&&_ps$stop!==void 0?_ps$stop:null,stop_token_ids:(_ps$stop_token_ids=ps.stop_token_ids)!==null&&_ps$stop_token_ids!==void 0?_ps$stop_token_ids:null};}}if(!errorAny){_context3.next=6;break;}setErrorMsg('Please fill in valid value for all fields');return _context3.abrupt(\"return\");case 6:_context3.prev=6;_context3.next=9;return fetcher(endPoint+'/v1/model_registrations/LLM',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 9:response=_context3.sent;if(response.ok){_context3.next=17;break;}_context3.next=13;return response.json();case 13:errorData=_context3.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context3.next=21;break;case 17:setSuccessMsg('Model has been registered successfully! Navigate to launch model page to proceed.');navigate('/launch_model/custom/llm');sessionStorage.setItem('modelType','/launch_model/custom/llm');sessionStorage.setItem('subType','/launch_model/custom/llm');case 21:_context3.next=27;break;case 23:_context3.prev=23;_context3.t0=_context3[\"catch\"](6);console.error('There was a problem with the fetch operation:',_context3.t0);setErrorMsg(_context3.t0.message||'An unexpected error occurred.');case 27:case\"end\":return _context3.stop();}},_callee3,null,[[6,23]]);}));return function handleClick(){return _ref3.apply(this,arguments);};}();var toggleLanguage=function toggleLanguage(lang){if(formData.model_lang.includes(lang)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:formData.model_lang.filter(function(l){return l!==lang;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:[].concat(_toConsumableArray(formData.model_lang),[lang])}));}};var toggleAbility=function toggleAbility(ability){setFamilyLabel('');if(formData.model_ability.includes(ability)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:formData.model_ability.filter(function(a){return a!==ability;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:[].concat(_toConsumableArray(formData.model_ability),[ability])}));}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Register Model\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:tabValue,onChange:function onChange(e,v){setTabValue(v);},\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Model\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Model\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Model\",value:\"3\"})]})}),/*#__PURE__*/_jsxs(TabPanel,{value:\"1\",sx:{padding:0},children:[/*#__PURE__*/_jsx(Box,{padding:\"20px\"}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(TextField,{label:\"Model Name\",error:errorModelName,defaultValue:formData.model_name,size:\"small\",helperText:\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_name:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5},children:\"Model Format\"}),/*#__PURE__*/_jsx(RadioGroup,{value:modelFormat,onChange:function onChange(e){setModelFormat(e.target.value);},children:/*#__PURE__*/_jsxs(Box,{sx:styles.checkboxWrapper,children:[/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"pytorch\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"PyTorch\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggmlv3\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGML\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggufv2\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGUF\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"gptq\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GPTQ\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"awq\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"AWQ\"})})]})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:errorContextLength,label:\"Context Length\",value:formData.context_length,size:\"small\",onChange:function onChange(event){var value=event.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,'')||'0';}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value='0';}// Update with the processed value\nsetFormData(_objectSpread(_objectSpread({},formData),{},{context_length:Number(value)}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Size in Billions\",size:\"small\",error:errorModelSize,value:modelSize,onChange:function onChange(e){var value=e.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,'')||'0';}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value='0';}setModelSize(Number(value));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Path\",size:\"small\",value:modelUri,onChange:function onChange(e){setModelUri(e.target.value);},helperText:\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Quantization (Optional)\",size:\"small\",value:quantization,onChange:function onChange(e){setQuantization(e.target.value);},helperText:\"For GPTQ/AWQ models, please be careful to fill in the quantization corresponding to the model you want to register.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Description (Optional)\",error:errorModelDescription,defaultValue:formData.model_description,size:\"small\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_description:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorLanguage?ERROR_COLOR:'inherit'},children:\"Model Languages\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_LANGUAGES.map(function(lang){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_lang.includes(lang),onChange:function onChange(){return toggleLanguage(lang);},name:lang,sx:errorLanguage?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:SUPPORTED_LANGUAGES_DICT[lang],style:{paddingLeft:10,color:errorLanguage?ERROR_COLOR:'inherit'}})},lang);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Model Abilities\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_FEATURES.map(function(ability){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_ability.includes(ability.toLowerCase()),onChange:function onChange(){return toggleAbility(ability.toLowerCase());},name:ability,sx:errorAbility?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:ability,style:{paddingLeft:10,color:errorAbility?ERROR_COLOR:'inherit'}})},ability);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Model Family\"}),/*#__PURE__*/_jsx(FormHelperText,{children:\"Please be careful to select the family name corresponding to the model you want to register. If not found, please choose `other`.\"}),/*#__PURE__*/_jsx(RadioGroup,{value:familyLabel,onChange:function onChange(e){setFamilyLabel(e.target.value);},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:getFamilyByAbility().map(function(v){return/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:v,control:/*#__PURE__*/_jsx(Radio,{}),label:v})});})})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(Box,{width:'100%',children:[successMsg!==''&&/*#__PURE__*/_jsxs(Alert,{severity:\"success\",children:[/*#__PURE__*/_jsx(AlertTitle,{children:\"Success\"}),successMsg]}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterEmbeddingModel,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterRerankModel,{})})]})]});};export default RegisterModel;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',maxWidth:'80%'},labelPaddingLeft:{paddingLeft:5},formControlLabelPaddingLeft:{paddingLeft:10},buttonBox:{width:'100%',margin:'20px'},error:{fontWeight:'bold',margin:'5px 0',padding:'1px',borderRadius:'5px'}};","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Checkbox","FormControl","FormControlLabel","FormHelperText","Radio","RadioGroup","Tab","Alert","AlertTitle","Button","TextField","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","fetcher","Title","useMode","RegisterEmbeddingModel","RegisterRerankModel","jsx","_jsx","jsxs","_jsxs","SUPPORTED_LANGUAGES_DICT","en","zh","SUPPORTED_FEATURES","SUPPORTED_LANGUAGES","Object","keys","RegisterModel","ERROR_COLOR","endPoint","_useContext","setErrorMsg","_useState","_useState2","_slicedToArray","successMsg","setSuccessMsg","_useState3","_useState4","modelFormat","setModelFormat","_useState5","_useState6","modelSize","setModelSize","_useState7","_useState8","modelUri","setModelUri","_useState9","_useState10","quantization","setQuantization","_useState11","version","context_length","model_name","model_lang","model_ability","model_description","model_family","model_specs","prompt_style","undefined","_useState12","formData","setFormData","_useState13","_useState14","promptStyles","setPromptStyles","_useState15","chat","generate","_useState16","family","setFamily","_useState17","_useState18","familyLabel","setFamilyLabel","_React$useState","_React$useState2","tabValue","setTabValue","_useCookies","_useCookies2","cookie","navigate","errorModelName","trim","length","errorModelDescription","errorContextLength","errorLanguage","errorAbility","errorModelSize","some","spec","model_size_in_billions","errorFamily","errorAny","token","sessionStorage","getItem","replace","getBuiltinFamilies","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","errorData","data","wrap","_callee$","_context","prev","next","fetch","method","headers","sent","ok","json","concat","status","detail","push","stop","apply","arguments","getBuiltInPromptStyles","_ref2","_callee2","res","key","v","_callee2$","_context2","catch","error","message","console","getFamilyByAbility","includes","isModelFormatPytorch","isModelFormatGPTQ","isModelFormatAWQ","getPathComponents","path","normalizedPath","baseDir","substring","lastIndexOf","filename","handleClick","_ref3","_callee3","_getPathComponents","ps","_ps$stop","_ps$stop_token_ids","_callee3$","_context3","model_format","quantizations","model_id","model_uri","model_file_name_template","find","item","name","style_name","system_prompt","roles","intra_message_sep","inter_message_sep","stop_token_ids","abrupt","body","JSON","stringify","model","persist","setItem","t0","toggleLanguage","lang","_objectSpread","filter","l","_toConsumableArray","toggleAbility","ability","a","m","children","title","value","sx","borderBottom","borderColor","onChange","e","label","padding","styles","baseFormControl","defaultValue","size","helperText","event","target","style","paddingLeft","checkboxWrapper","marginLeft","control","test","parseInt","Number","color","map","marginRight","checked","toLowerCase","width","severity","variant","type","onClick","margin","display","flexWrap","maxWidth","labelPaddingLeft","formControlLabelPaddingLeft","buttonBox","fontWeight","borderRadius"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport {\n Box,\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText,\n Radio,\n RadioGroup,\n Tab,\n} from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport AlertTitle from '@mui/material/AlertTitle'\nimport Button from '@mui/material/Button'\nimport TextField from '@mui/material/TextField'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetcher from '../../components/fetcher'\nimport Title from '../../components/Title'\nimport { useMode } from '../../theme'\nimport RegisterEmbeddingModel from './register_embedding'\nimport RegisterRerankModel from './register_rerank'\n\nconst SUPPORTED_LANGUAGES_DICT = { en: 'English', zh: 'Chinese' }\nconst SUPPORTED_FEATURES = ['Generate', 'Chat']\n\n// Convert dictionary of supported languages into list\nconst SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT)\n\nconst RegisterModel = () => {\n const ERROR_COLOR = useMode()\n const endPoint = useContext(ApiContext).endPoint\n const { setErrorMsg } = useContext(ApiContext)\n const [successMsg, setSuccessMsg] = useState('')\n const [modelFormat, setModelFormat] = useState('pytorch')\n const [modelSize, setModelSize] = useState(7)\n const [modelUri, setModelUri] = useState('/path/to/llama-2')\n const [quantization, setQuantization] = useState('')\n const [formData, setFormData] = useState({\n version: 1,\n context_length: 2048,\n model_name: 'custom-llama-2',\n model_lang: ['en'],\n model_ability: ['generate'],\n model_description: 'This is a custom model description.',\n model_family: '',\n model_specs: [],\n prompt_style: undefined,\n })\n const [promptStyles, setPromptStyles] = useState([])\n const [family, setFamily] = useState({\n chat: [],\n generate: [],\n })\n const [familyLabel, setFamilyLabel] = useState('')\n const [tabValue, setTabValue] = React.useState('1')\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n\n const errorModelName = formData.model_name.trim().length <= 0\n const errorModelDescription = formData.model_description.length < 0\n const errorContextLength = formData.context_length === 0\n const errorLanguage =\n formData.model_lang === undefined || formData.model_lang.length === 0\n const errorAbility =\n formData.model_ability === undefined || formData.model_ability.length === 0\n const errorModelSize =\n formData.model_specs &&\n formData.model_specs.some((spec) => {\n return (\n spec.model_size_in_billions === undefined ||\n spec.model_size_in_billions === 0\n )\n })\n const errorFamily = familyLabel === ''\n const errorAny =\n errorModelName ||\n errorModelDescription ||\n errorContextLength ||\n errorLanguage ||\n errorAbility ||\n errorModelSize ||\n errorFamily\n\n useEffect(() => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token !== 'no_auth' && !sessionStorage.getItem('token')) {\n navigate('/login', { replace: true })\n return\n }\n\n const getBuiltinFamilies = async () => {\n const response = await fetch(endPoint + '/v1/models/families', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n const data = await response.json()\n data.chat.push('other')\n data.generate.push('other')\n setFamily(data)\n }\n }\n\n const getBuiltInPromptStyles = async () => {\n const response = await fetch(endPoint + '/v1/models/prompts', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n const data = await response.json()\n let res = []\n for (const key in data) {\n let v = data[key]\n v['name'] = key\n res.push(v)\n }\n setPromptStyles(res)\n }\n }\n // avoid keep requesting backend to get prompts\n if (promptStyles.length === 0) {\n getBuiltInPromptStyles().catch((error) => {\n setErrorMsg(\n error.message ||\n 'An unexpected error occurred when getting builtin prompt styles.'\n )\n console.error('Error: ', error)\n })\n }\n if (family.chat.length === 0) {\n getBuiltinFamilies().catch((error) => {\n setErrorMsg(\n error.message ||\n 'An unexpected error occurred when getting builtin prompt styles.'\n )\n console.error('Error: ', error)\n })\n }\n }, [cookie.token])\n\n const getFamilyByAbility = () => {\n if (formData.model_ability.includes('chat')) {\n return family.chat\n } else {\n return family.generate\n }\n }\n\n const isModelFormatPytorch = () => {\n return modelFormat === 'pytorch'\n }\n\n const isModelFormatGPTQ = () => {\n return modelFormat === 'gptq'\n }\n\n const isModelFormatAWQ = () => {\n return modelFormat === 'awq'\n }\n\n const getPathComponents = (path) => {\n const normalizedPath = path.replace(/\\\\/g, '/')\n const baseDir = normalizedPath.substring(0, normalizedPath.lastIndexOf('/'))\n const filename = normalizedPath.substring(\n normalizedPath.lastIndexOf('/') + 1\n )\n return { baseDir, filename }\n }\n\n const handleClick = async () => {\n if (isModelFormatGPTQ()) {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [quantization],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n } else if (isModelFormatAWQ()) {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [quantization],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n } else if (!isModelFormatPytorch()) {\n const { baseDir, filename } = getPathComponents(modelUri)\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [quantization],\n model_id: '',\n model_file_name_template: filename,\n model_uri: baseDir,\n },\n ]\n } else {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: ['4-bit', '8-bit', 'none'],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n }\n\n formData.model_family = familyLabel\n\n if (formData.model_ability.includes('chat')) {\n const ps = promptStyles.find((item) => item.name === familyLabel)\n if (ps) {\n formData.prompt_style = {\n style_name: ps.style_name,\n system_prompt: ps.system_prompt,\n roles: ps.roles,\n intra_message_sep: ps.intra_message_sep,\n inter_message_sep: ps.inter_message_sep,\n stop: ps.stop ?? null,\n stop_token_ids: ps.stop_token_ids ?? null,\n }\n }\n }\n\n if (errorAny) {\n setErrorMsg('Please fill in valid value for all fields')\n return\n }\n\n try {\n const response = await fetcher(endPoint + '/v1/model_registrations/LLM', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: JSON.stringify(formData),\n persist: true,\n }),\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n setSuccessMsg(\n 'Model has been registered successfully! Navigate to launch model page to proceed.'\n )\n navigate('/launch_model/custom/llm')\n sessionStorage.setItem('modelType', '/launch_model/custom/llm')\n sessionStorage.setItem('subType', '/launch_model/custom/llm')\n }\n } catch (error) {\n console.error('There was a problem with the fetch operation:', error)\n setErrorMsg(error.message || 'An unexpected error occurred.')\n }\n }\n\n const toggleLanguage = (lang) => {\n if (formData.model_lang.includes(lang)) {\n setFormData({\n ...formData,\n model_lang: formData.model_lang.filter((l) => l !== lang),\n })\n } else {\n setFormData({\n ...formData,\n model_lang: [...formData.model_lang, lang],\n })\n }\n }\n\n const toggleAbility = (ability) => {\n setFamilyLabel('')\n if (formData.model_ability.includes(ability)) {\n setFormData({\n ...formData,\n model_ability: formData.model_ability.filter((a) => a !== ability),\n })\n } else {\n setFormData({\n ...formData,\n model_ability: [...formData.model_ability, ability],\n })\n }\n }\n\n return (\n <Box m=\"20px\">\n <Title title=\"Register Model\" />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={(e, v) => {\n setTabValue(v)\n }}\n aria-label=\"tabs\"\n >\n <Tab label=\"Language Model\" value=\"1\" />\n <Tab label=\"Embedding Model\" value=\"2\" />\n <Tab label=\"Rerank Model\" value=\"3\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <Box padding=\"20px\"></Box>\n {/* Base Information */}\n <FormControl sx={styles.baseFormControl}>\n <TextField\n label=\"Model Name\"\n error={errorModelName}\n defaultValue={formData.model_name}\n size=\"small\"\n helperText=\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\"\n onChange={(event) =>\n setFormData({ ...formData, model_name: event.target.value })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n }}\n >\n Model Format\n </label>\n\n <RadioGroup\n value={modelFormat}\n onChange={(e) => {\n setModelFormat(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"pytorch\"\n control={<Radio />}\n label=\"PyTorch\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"ggmlv3\"\n control={<Radio />}\n label=\"GGML\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"ggufv2\"\n control={<Radio />}\n label=\"GGUF\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"gptq\"\n control={<Radio />}\n label=\"GPTQ\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"awq\"\n control={<Radio />}\n label=\"AWQ\"\n />\n </Box>\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={errorContextLength}\n label=\"Context Length\"\n value={formData.context_length}\n size=\"small\"\n onChange={(event) => {\n let value = event.target.value\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, '') || '0'\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = '0'\n }\n // Update with the processed value\n setFormData({\n ...formData,\n context_length: Number(value),\n })\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Size in Billions\"\n size=\"small\"\n error={errorModelSize}\n value={modelSize}\n onChange={(e) => {\n let value = e.target.value\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, '') || '0'\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = '0'\n }\n setModelSize(Number(value))\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Path\"\n size=\"small\"\n value={modelUri}\n onChange={(e) => {\n setModelUri(e.target.value)\n }}\n helperText=\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Quantization (Optional)\"\n size=\"small\"\n value={quantization}\n onChange={(e) => {\n setQuantization(e.target.value)\n }}\n helperText=\"For GPTQ/AWQ models, please be careful to fill in the quantization corresponding to the model you want to register.\"\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Description (Optional)\"\n error={errorModelDescription}\n defaultValue={formData.model_description}\n size=\"small\"\n onChange={(event) =>\n setFormData({\n ...formData,\n model_description: event.target.value,\n })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Languages\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_LANGUAGES.map((lang) => (\n <Box key={lang} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_lang.includes(lang)}\n onChange={() => toggleLanguage(lang)}\n name={lang}\n sx={\n errorLanguage\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={SUPPORTED_LANGUAGES_DICT[lang]}\n style={{\n paddingLeft: 10,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Abilities\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_FEATURES.map((ability) => (\n <Box key={ability} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_ability.includes(\n ability.toLowerCase()\n )}\n onChange={() => toggleAbility(ability.toLowerCase())}\n name={ability}\n sx={\n errorAbility\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={ability}\n style={{\n paddingLeft: 10,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <FormControl sx={styles.baseFormControl}>\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Family\n </label>\n <FormHelperText>\n Please be careful to select the family name corresponding to the\n model you want to register. If not found, please choose `other`.\n </FormHelperText>\n <RadioGroup\n value={familyLabel}\n onChange={(e) => {\n setFamilyLabel(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n {getFamilyByAbility().map((v) => (\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel value={v} control={<Radio />} label={v} />\n </Box>\n ))}\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <Box width={'100%'}>\n {successMsg !== '' && (\n <Alert severity=\"success\">\n <AlertTitle>Success</AlertTitle>\n {successMsg}\n </Alert>\n )}\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleClick}\n >\n Register Model\n </Button>\n </Box>\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <RegisterEmbeddingModel />\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <RegisterRerankModel />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RegisterModel\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n maxWidth: '80%',\n },\n labelPaddingLeft: {\n paddingLeft: 5,\n },\n formControlLabelPaddingLeft: {\n paddingLeft: 10,\n },\n buttonBox: {\n width: '100%',\n margin: '20px',\n },\n error: {\n fontWeight: 'bold',\n margin: '5px 0',\n padding: '1px',\n borderRadius: '5px',\n },\n}\n"],"mappings":"wtBAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OACEC,GAAG,CACHC,QAAQ,CACRC,WAAW,CACXC,gBAAgB,CAChBC,cAAc,CACdC,KAAK,CACLC,UAAU,CACVC,GAAG,KACE,eAAe,CACtB,MAAO,CAAAC,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,MAAM,KAAM,sBAAsB,CACzC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,KAAK,KAAM,wBAAw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AAEM,OAAO,CAAE,CAAE,CAAE,CAAAT,QAAA,cACrCrL,IAAA,CAACH,sBAAsB,GAAE,CAAC,CAClB,CAAC,cACXG,IAAA,CAAC3B,QAAQ,EAACkN,KAAK,CAAC,GAAG,CAACC,EAAE,CAAE,CAAEM,OAAO,CAAE,CAAE,CAAE,CAAAT,QAAA,cACrCrL,IAAA,CAACF,mBAAmB,GAAE,CAAC,CACf,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAY,aAAa,CAE5B,GAAM,CAAAqL,MAAM,CAAG,CACbC,eAAe,CAAE,CACfmB,KAAK,CAAE,MAAM,CACbK,MAAM,CAAE,QAAQ,CAChBtB,IAAI,CAAE,OACR,CAAC,CACDM,eAAe,CAAE,CACfiB,OAAO,CAAE,MAAM,CACfC,QAAQ,CAAE,MAAM,CAChBC,QAAQ,CAAE,KACZ,CAAC,CACDC,gBAAgB,CAAE,CAChBrB,WAAW,CAAE,CACf,CAAC,CACDsB,2BAA2B,CAAE,CAC3BtB,WAAW,CAAE,EACf,CAAC,CACDuB,SAAS,CAAE,CACTX,KAAK,CAAE,MAAM,CACbK,MAAM,CAAE,MACV,CAAC,CACD3F,KAAK,CAAE,CACLkG,UAAU,CAAE,MAAM,CAClBP,MAAM,CAAE,OAAO,CACf1B,OAAO,CAAE,KAAK,CACdkC,YAAY,CAAE,KAChB,CACF,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,FormControl,Tab}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import HotkeyFocusTextField from'../../components/hotkeyFocusTextField';import ModelCard from'./modelCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchCustom=function LaunchCustom(_ref){var gpuAvailable=_ref.gpuAvailable;var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;// States used for filtering\nvar _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(sessionStorage.getItem('subType')),_useState6=_slicedToArray(_useState5,2),value=_useState6[0],setValue=_useState6[1];var navigate=useNavigate();var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);update();navigate(newValue);sessionStorage.setItem('subType',newValue);};var handleChange=function handleChange(event){setSearchTerm(event.target.value);};var filter=function filter(registration){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';return modelName.includes(searchTerm.toLowerCase());};var update=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var rerankResponse,rerankRegistrations,customRerankRegistrations,embeddingResponse,embeddingRegistrations,customEmbeddingRegistrations,llmResponse,llmRegistrations,customLLMRegistrations,newEmbeddingData,newLLMData,newRerankData;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context4.next=2;break;}return _context4.abrupt(\"return\");case 2:_context4.prev=2;setIsCallingApi(true);_context4.next=6;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/rerank\"),{method:'GET'});case 6:rerankResponse=_context4.sent;_context4.next=9;return rerankResponse.json();case 9:rerankRegistrations=_context4.sent;customRerankRegistrations=rerankRegistrations.filter(function(data){return!data.is_builtin;});_context4.next=13;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/embedding\"),{method:'GET'});case 13:embeddingResponse=_context4.sent;_context4.next=16;return embeddingResponse.json();case 16:embeddingRegistrations=_context4.sent;customEmbeddingRegistrations=embeddingRegistrations.filter(function(data){return!data.is_builtin;});_context4.next=20;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/LLM\"),{method:'GET'});case 20:llmResponse=_context4.sent;_context4.next=23;return llmResponse.json();case 23:llmRegistrations=_context4.sent;customLLMRegistrations=llmRegistrations.filter(function(data){return!data.is_builtin;});_context4.next=27;return Promise.all(customEmbeddingRegistrations.map(/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/embedding/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context.sent;_context.t0=_objectSpread;_context.t1=_objectSpread;_context.t2={};_context.next=8;return desc.json();case 8:_context.t3=_context.sent;_context.t4=(0,_context.t1)(_context.t2,_context.t3);_context.t5={};_context.t6={is_builtin:registration.is_builtin};return _context.abrupt(\"return\",(0,_context.t0)(_context.t4,_context.t5,_context.t6));case 13:case\"end\":return _context.stop();}},_callee);}));return function(_x){return _ref3.apply(this,arguments);};}()));case 27:newEmbeddingData=_context4.sent;_context4.next=30;return Promise.all(customLLMRegistrations.map(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(registration){var desc;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/LLM/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context2.sent;_context2.t0=_objectSpread;_context2.t1=_objectSpread;_context2.t2={};_context2.next=8;return desc.json();case 8:_context2.t3=_context2.sent;_context2.t4=(0,_context2.t1)(_context2.t2,_context2.t3);_context2.t5={};_context2.t6={is_builtin:registration.is_builtin};return _context2.abrupt(\"return\",(0,_context2.t0)(_context2.t4,_context2.t5,_context2.t6));case 13:case\"end\":return _context2.stop();}},_callee2);}));return function(_x2){return _ref4.apply(this,arguments);};}()));case 30:newLLMData=_context4.sent;_context4.next=33;return Promise.all(customRerankRegistrations.map(/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(registration){var desc;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/rerank/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context3.sent;_context3.t0=_objectSpread;_context3.t1=_objectSpread;_context3.t2={};_context3.next=8;return desc.json();case 8:_context3.t3=_context3.sent;_context3.t4=(0,_context3.t1)(_context3.t2,_context3.t3);_context3.t5={};_context3.t6={is_builtin:registration.is_builtin};return _context3.abrupt(\"return\",(0,_context3.t0)(_context3.t4,_context3.t5,_context3.t6));case 13:case\"end\":return _context3.stop();}},_callee3);}));return function(_x3){return _ref5.apply(this,arguments);};}()));case 33:newRerankData=_context4.sent;setRegistrationData(newLLMData.concat(newEmbeddingData).concat(newRerankData));_context4.next=40;break;case 37:_context4.prev=37;_context4.t0=_context4[\"catch\"](2);console.error('Error:',_context4.t0);case 40:_context4.prev=40;setIsCallingApi(false);return _context4.finish(40);case 43:case\"end\":return _context4.stop();}},_callee4,null,[[2,37,40,43]]);}));return function update(){return _ref2.apply(this,arguments);};}();useEffect(function(){update();},[]);var style={display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',paddingBottom:'2rem',gridGap:'2rem 0rem'};return/*#__PURE__*/_jsx(Box,{m:\"20px\",children:/*#__PURE__*/_jsxs(TabContext,{value:value,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:value,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Models\",value:\"/launch_model/custom/llm\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"/launch_model/custom/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Models\",value:\"/launch_model/custom/rerank\"})]})}),/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/llm\",sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for custom model name\",value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(!(filteredRegistration.max_tokens&&filteredRegistration.dimensions)&&!(filteredRegistration.model_type&&filteredRegistration.model_type==='rerank')){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,is_custom:true,modelType:\"LLM\"},filteredRegistration.model_name);}})})]}),/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/embedding\",sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for custom model name\",value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(filteredRegistration.max_tokens&&filteredRegistration.dimensions){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,is_custom:true,modelType:\"embedding\"},filteredRegistration.model_name);}})})]}),/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/rerank\",sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for custom model name\",value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(filteredRegistration.model_type&&filteredRegistration.model_type==='rerank'){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,is_custom:true,modelType:\"rerank\"},filteredRegistration.model_name);}})})]})]})});};export default LaunchCustom;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","FormControl","Tab","React","useContext","useEffect","useState","useNavigate","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","LaunchCustom","_ref","gpuAvailable","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","sessionStorage","getItem","_useState6","value","setValue","navigate","handleTabChange","event","newValue","update","setItem","handleChange","target","filter","registration","modelName","model_name","toLowerCase","includes","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee4","rerankResponse","rerankRegistrations","customRerankRegistrations","embeddingResponse","embeddingRegistrations","customEmbeddingRegistrations","llmResponse","llmRegistrations","customLLMRegistrations","newEmbeddingData","newLLMData","newRerankData","wrap","_callee4$","_context4","prev","next","abrupt","concat","method","sent","json","data","is_builtin","Promise","all","map","_ref3","_callee","desc","_callee$","_context","t0","_objectSpread","t1","t2","t3","t4","t5","t6","stop","_x","apply","arguments","_ref4","_callee2","_callee2$","_context2","_x2","_ref5","_callee3","_callee3$","_context3","_x3","console","error","finish","style","display","gridTemplateColumns","paddingLeft","paddingBottom","gridGap","m","children","sx","borderBottom","borderColor","onChange","label","padding","margin","variant","id","type","size","hotkey","filteredRegistration","max_tokens","dimensions","model_type","url","modelData","is_custom","modelType"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchCustom.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, FormControl, Tab } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\n\nconst LaunchCustom = ({ gpuAvailable }) => {\n let endPoint = useContext(ApiContext).endPoint\n const [registrationData, setRegistrationData] = useState([])\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState('')\n const [value, setValue] = useState(sessionStorage.getItem('subType'))\n\n const navigate = useNavigate()\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n update()\n navigate(newValue)\n sessionStorage.setItem('subType', newValue)\n }\n\n const handleChange = (event) => {\n setSearchTerm(event.target.value)\n }\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n return modelName.includes(searchTerm.toLowerCase())\n }\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return\n\n try {\n setIsCallingApi(true)\n\n const rerankResponse = await fetcher(\n `${endPoint}/v1/model_registrations/rerank`,\n {\n method: 'GET',\n }\n )\n const rerankRegistrations = await rerankResponse.json()\n const customRerankRegistrations = rerankRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const embeddingResponse = await fetcher(\n `${endPoint}/v1/model_registrations/embedding`,\n {\n method: 'GET',\n }\n )\n\n const embeddingRegistrations = await embeddingResponse.json()\n const customEmbeddingRegistrations = embeddingRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const llmResponse = await fetcher(\n `${endPoint}/v1/model_registrations/LLM`,\n {\n method: 'GET',\n }\n )\n const llmRegistrations = await llmResponse.json()\n const customLLMRegistrations = llmRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const newEmbeddingData = await Promise.all(\n customEmbeddingRegistrations.map(async (registration) => {\n const desc = await fetcher(\n `${endPoint}/v1/model_registrations/embedding/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n const newLLMData = await Promise.all(\n customLLMRegistrations.map(async (registration) => {\n const desc = await fetcher(\n `${endPoint}/v1/model_registrations/LLM/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n const newRerankData = await Promise.all(\n customRerankRegistrations.map(async (registration) => {\n const desc = await fetcher(\n `${endPoint}/v1/model_registrations/rerank/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n setRegistrationData(\n newLLMData.concat(newEmbeddingData).concat(newRerankData)\n )\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [])\n\n const style = {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n paddingBottom: '2rem',\n gridGap: '2rem 0rem',\n }\n\n return (\n <Box m=\"20px\">\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label=\"Language Models\" value=\"/launch_model/custom/llm\" />\n <Tab\n label=\"Embedding Models\"\n value=\"/launch_model/custom/embedding\"\n />\n <Tab label=\"Rerank Models\" value=\"/launch_model/custom/rerank\" />\n </TabList>\n </Box>\n <TabPanel value=\"/launch_model/custom/llm\" sx={{ padding: 0 }}>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for custom model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => {\n if (\n !(\n filteredRegistration.max_tokens &&\n filteredRegistration.dimensions\n ) &&\n !(\n filteredRegistration.model_type &&\n filteredRegistration.model_type === 'rerank'\n )\n ) {\n return (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n is_custom={true}\n modelType=\"LLM\"\n />\n )\n }\n })}\n </div>\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/embedding\" sx={{ padding: 0 }}>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for custom model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => {\n if (\n filteredRegistration.max_tokens &&\n filteredRegistration.dimensions\n ) {\n return (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n is_custom={true}\n modelType=\"embedding\"\n />\n )\n }\n })}\n </div>\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/rerank\" sx={{ padding: 0 }}>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for custom model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => {\n if (\n filteredRegistration.model_type &&\n filteredRegistration.model_type === 'rerank'\n ) {\n return (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n is_custom={true}\n modelType=\"rerank\"\n />\n )\n }\n })}\n </div>\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default LaunchCustom\n"],"mappings":"mkBAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,WAAW,CAAEC,GAAG,KAAQ,eAAe,CACrD,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,SAAS,KAAM,aAAa,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEnC,G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