xinference 0.12.3__py3-none-any.whl → 0.13.0__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.

Files changed (71) hide show
  1. xinference/_version.py +3 -3
  2. xinference/api/restful_api.py +6 -6
  3. xinference/client/restful/restful_client.py +0 -2
  4. xinference/core/model.py +21 -4
  5. xinference/core/scheduler.py +2 -0
  6. xinference/core/worker.py +74 -45
  7. xinference/deploy/utils.py +33 -2
  8. xinference/model/llm/__init__.py +5 -0
  9. xinference/model/llm/llm_family.json +240 -1
  10. xinference/model/llm/llm_family.py +32 -8
  11. xinference/model/llm/llm_family_modelscope.json +192 -0
  12. xinference/model/llm/mlx/__init__.py +13 -0
  13. xinference/model/llm/mlx/core.py +408 -0
  14. xinference/model/llm/pytorch/chatglm.py +2 -9
  15. xinference/model/llm/pytorch/cogvlm2.py +206 -21
  16. xinference/model/llm/pytorch/core.py +213 -40
  17. xinference/model/llm/pytorch/glm4v.py +171 -15
  18. xinference/model/llm/pytorch/qwen_vl.py +168 -7
  19. xinference/model/llm/pytorch/utils.py +53 -62
  20. xinference/model/llm/utils.py +24 -5
  21. xinference/model/rerank/core.py +5 -0
  22. xinference/thirdparty/deepseek_vl/serve/__init__.py +13 -0
  23. xinference/thirdparty/deepseek_vl/serve/app_deepseek.py +510 -0
  24. xinference/thirdparty/deepseek_vl/serve/app_modules/__init__.py +13 -0
  25. xinference/thirdparty/deepseek_vl/serve/app_modules/gradio_utils.py +94 -0
  26. xinference/thirdparty/deepseek_vl/serve/app_modules/overwrites.py +81 -0
  27. xinference/thirdparty/deepseek_vl/serve/app_modules/presets.py +96 -0
  28. xinference/thirdparty/deepseek_vl/serve/app_modules/utils.py +229 -0
  29. xinference/thirdparty/deepseek_vl/serve/inference.py +170 -0
  30. xinference/web/ui/build/asset-manifest.json +3 -3
  31. xinference/web/ui/build/index.html +1 -1
  32. xinference/web/ui/build/static/js/main.0fb6f3ab.js +3 -0
  33. xinference/web/ui/build/static/js/main.0fb6f3ab.js.map +1 -0
  34. xinference/web/ui/node_modules/.cache/babel-loader/0f6b391abec76271137faad13a3793fe7acc1024e8cd2269c147b653ecd3a73b.json +1 -0
  35. xinference/web/ui/node_modules/.cache/babel-loader/1130403f9e46f5738a23b45ac59b57de8f360c908c713e2c0670c2cce9bd367a.json +1 -0
  36. xinference/web/ui/node_modules/.cache/babel-loader/1444c41a4d04494f1cbc2d8c1537df107b451cb569cb2c1fbf5159f3a4841a5f.json +1 -0
  37. xinference/web/ui/node_modules/.cache/babel-loader/2c63090c842376cdd368c3ded88a333ef40d94785747651343040a6f7872a223.json +1 -0
  38. xinference/web/ui/node_modules/.cache/babel-loader/30a0c79d8025d6441eb75b2df5bc2750a14f30119c869ef02570d294dff65c2f.json +1 -0
  39. xinference/web/ui/node_modules/.cache/babel-loader/40486e655c3c5801f087e2cf206c0b5511aaa0dfdba78046b7181bf9c17e54c5.json +1 -0
  40. xinference/web/ui/node_modules/.cache/babel-loader/6450605fac003812485f6251b9f0caafbf2e5bfc3bbe2f000050d9e2fdb8dcd3.json +1 -0
  41. xinference/web/ui/node_modules/.cache/babel-loader/8a9742ddd8ba8546ef42dc14caca443f2b4524fabed7bf269e0eff3b7b64ee7d.json +1 -0
  42. xinference/web/ui/node_modules/.cache/babel-loader/9375a35b05d56989b2755bf72161fa707c92f28569d33765a75f91a568fda6e9.json +1 -0
  43. xinference/web/ui/node_modules/.cache/babel-loader/b5507cd57f16a3a230aa0128e39fe103e928de139ea29e2679e4c64dcbba3b3a.json +1 -0
  44. xinference/web/ui/node_modules/.cache/babel-loader/d6c643278a0b28320e6f33a60f5fb64c053997cbdc39a60e53ccc574688ade9e.json +1 -0
  45. xinference/web/ui/node_modules/.cache/babel-loader/d779b915f83f9c7b5a72515b6932fdd114f1822cef90ae01cc0d12bca59abc2d.json +1 -0
  46. xinference/web/ui/node_modules/.cache/babel-loader/d87824cb266194447a9c0c69ebab2d507bfc3e3148976173760d18c035e9dd26.json +1 -0
  47. xinference/web/ui/node_modules/.cache/babel-loader/d93730e2b5d7e8c957b4d0965d2ed1dac9045a649adbd47c220d11f255d4b1e0.json +1 -0
  48. xinference/web/ui/node_modules/.cache/babel-loader/e656dc00b4d8b387f0a81ba8fc558767df1601c66369e2eb86a5ef27cf080572.json +1 -0
  49. {xinference-0.12.3.dist-info → xinference-0.13.0.dist-info}/METADATA +4 -1
  50. {xinference-0.12.3.dist-info → xinference-0.13.0.dist-info}/RECORD +55 -44
  51. xinference/web/ui/build/static/js/main.77dd47c3.js +0 -3
  52. xinference/web/ui/build/static/js/main.77dd47c3.js.map +0 -1
  53. xinference/web/ui/node_modules/.cache/babel-loader/0cd591866aa345566e0b63fb51ff2043e163a770af6fdc2f3bad395d046353e2.json +0 -1
  54. xinference/web/ui/node_modules/.cache/babel-loader/37c1476717199863bbba1530e3513a9368f8f73001b75b4a85c2075956308027.json +0 -1
  55. xinference/web/ui/node_modules/.cache/babel-loader/3da7d55e87882a4af923e187b1351160e34ca102f589086439c15131a227fb6e.json +0 -1
  56. xinference/web/ui/node_modules/.cache/babel-loader/3fa1f69162f9c6dc0f6a6e21b64d49d6b8e6fa8dfa59a82cf829931c5f97d99f.json +0 -1
  57. xinference/web/ui/node_modules/.cache/babel-loader/46edc1fe657dfedb2e673148332bb442c6eb98f09f2592c389209e376510afa5.json +0 -1
  58. xinference/web/ui/node_modules/.cache/babel-loader/62e257ed9016471035fa1a7da57c9e2a4250974ed566b4d1295873d747c68eb2.json +0 -1
  59. xinference/web/ui/node_modules/.cache/babel-loader/72bcecc71c5267250edeb89608859d449b586f13ff9923a5e70e7172976ec403.json +0 -1
  60. xinference/web/ui/node_modules/.cache/babel-loader/82db357f3fd5b32215d747ee593f69ff06c95ad6cde37f71a96c8290aaab64c0.json +0 -1
  61. xinference/web/ui/node_modules/.cache/babel-loader/935efd2867664c58230378fdf2ff1ea85e58d853b7214014e20dfbca8dab7b05.json +0 -1
  62. xinference/web/ui/node_modules/.cache/babel-loader/bc6da27195ec4607bb472bf61f97c928ad4966fa64e4c2247661bedb7400abba.json +0 -1
  63. xinference/web/ui/node_modules/.cache/babel-loader/c2abe75f04ad82fba68f35ed9cbe2e287762c876684fddccccfa73f739489b65.json +0 -1
  64. xinference/web/ui/node_modules/.cache/babel-loader/e606671420d2937102c3c34b4b04056c11736408c1d3347b8cf42dfe61fb394b.json +0 -1
  65. xinference/web/ui/node_modules/.cache/babel-loader/f118f99c22b713c678c1209c4e1dd43fe86e3f6e801a4c0c35d3bbf41fd05fe6.json +0 -1
  66. xinference/web/ui/node_modules/.cache/babel-loader/f51bf63ddaa7afd125ef2254a105789333eecc1c94fdf5157a9b88ef7ad0a5bd.json +0 -1
  67. /xinference/web/ui/build/static/js/{main.77dd47c3.js.LICENSE.txt → main.0fb6f3ab.js.LICENSE.txt} +0 -0
  68. {xinference-0.12.3.dist-info → xinference-0.13.0.dist-info}/LICENSE +0 -0
  69. {xinference-0.12.3.dist-info → xinference-0.13.0.dist-info}/WHEEL +0 -0
  70. {xinference-0.12.3.dist-info → xinference-0.13.0.dist-info}/entry_points.txt +0 -0
  71. {xinference-0.12.3.dist-info → xinference-0.13.0.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 _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Chip,FormControl,InputLabel,MenuItem,Select}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{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchModelComponent=function LaunchModelComponent(_ref){var modelType=_ref.modelType,gpuAvailable=_ref.gpuAvailable;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 _useState5=useState(''),_useState6=_slicedToArray(_useState5,2),status=_useState6[0],setStatus=_useState6[1];var _useState7=useState([]),_useState8=_slicedToArray(_useState7,2),completeDeleteArr=_useState8[0],setCompleteDeleteArr=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),collectionArr=_useState10[0],setCollectionArr=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),filterArr=_useState12[0],setFilterArr=_useState12[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var filter=function filter(registration){if(searchTerm!==''){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';if(!modelName.includes(searchTerm.toLowerCase())){return false;}}if(completeDeleteArr.includes(registration.model_name)){registration.cache_status=Array.isArray(registration.cache_status)?[false]:false;}if(filterArr.length===1){if(filterArr[0]==='cached'){return registration.cache_status&&!completeDeleteArr.includes(registration.model_name);}else{return collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name);}}else if(filterArr.length>1){return registration.cache_status&&!completeDeleteArr.includes(registration.model_name)&&(collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name));}return true;};var handleCompleteDelete=function handleCompleteDelete(model_name){setCompleteDeleteArr([].concat(_toConsumableArray(completeDeleteArr),[model_name]));};var update=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,registrations,builtinModels,collectionData;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);collectionData=JSON.parse(localStorage.getItem('collectionArr'));setCollectionArr(collectionData);_context.next=19;break;case 16:_context.prev=16;_context.t0=_context[\"catch\"](2);console.error('Error:',_context.t0);case 19:_context.prev=19;setIsCallingApi(false);return _context.finish(19);case 22:case\"end\":return _context.stop();}},_callee,null,[[2,16,19,22]]);}));return function update(){return _ref2.apply(this,arguments);};}();useEffect(function(){update();},[]);var getCollectionArr=function getCollectionArr(data){setCollectionArr(data);};var handleChangeFilter=function handleChangeFilter(value){setStatus(value);var arr=[].concat(_toConsumableArray(filterArr.filter(function(item){return item!==value;})),[value]);setFilterArr(arr);};var handleDeleteChip=function handleDeleteChip(item){setFilterArr(filterArr.filter(function(subItem){return subItem!==item;}));if(item===status)setStatus('');};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'grid',gridTemplateColumns:'150px 1fr',columnGap:'20px',margin:'30px 2rem'},children:[/*#__PURE__*/_jsxs(FormControl,{sx:{marginTop:2,minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"select-status\",children:\"Status\"}),/*#__PURE__*/_jsxs(Select,{id:\"status\",labelId:\"select-status\",label:\"Status\",onChange:function onChange(e){return handleChangeFilter(e.target.value);},value:status,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"cached\",children:\"cached\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"favorite\",children:\"favorite\"})]})]}),/*#__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:function onChange(e){return setSearchTerm(e.target.value);},size:\"small\",hotkey:\"/\"})})]}),/*#__PURE__*/_jsx(\"div\",{style:{margin:'0 0 30px 30px'},children:filterArr.map(function(item,index){return/*#__PURE__*/_jsx(Chip,{label:item,variant:\"outlined\",size:\"small\",color:\"primary\",style:{marginRight:10},onDelete:function onDelete(){return handleDeleteChip(item);}},index);})}),/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',gridGap:'2rem 0rem'},children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,modelType:modelType,gpuAvailable:gpuAvailable,onHandleCompleteDelete:handleCompleteDelete,onGetCollectionArr:getCollectionArr},filteredRegistration.model_name);})})]});};export default LaunchModelComponent;","map":{"version":3,"names":["Box","Chip","FormControl","InputLabel","MenuItem","Select","React","useContext","useEffect","useState","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","LaunchModelComponent","_ref","modelType","gpuAvailable","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","_useState6","status","setStatus","_useState7","_useState8","completeDeleteArr","setCompleteDeleteArr","_useState9","_useState10","collectionArr","setCollectionArr","_useState11","_useState12","filterArr","setFilterArr","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","filter","registration","modelName","model_name","toLowerCase","includes","cache_status","Array","isArray","length","handleCompleteDelete","concat","_toConsumableArray","update","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","registrations","builtinModels","collectionData","wrap","_callee$","_context","prev","next","abrupt","method","sent","json","v","is_builtin","JSON","parse","localStorage","getItem","t0","console","error","finish","stop","apply","arguments","getCollectionArr","data","handleChangeFilter","value","arr","item","handleDeleteChip","subItem","m","children","style","display","gridTemplateColumns","columnGap","margin","sx","marginTop","minWidth","size","id","labelId","label","onChange","e","target","width","variant","type","hotkey","map","index","color","marginRight","onDelete","paddingLeft","gridGap","filteredRegistration","url","modelData","onHandleCompleteDelete","onGetCollectionArr"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/LaunchModelComponent.js"],"sourcesContent":["import {\n Box,\n Chip,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n} 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'\n\nconst LaunchModelComponent = ({ modelType, gpuAvailable }) => {\n let endPoint = useContext(ApiContext).endPoint\n const [registrationData, setRegistrationData] = useState([])\n const [searchTerm, setSearchTerm] = useState('')\n const [status, setStatus] = useState('')\n const [completeDeleteArr, setCompleteDeleteArr] = useState([])\n const [collectionArr, setCollectionArr] = useState([])\n const [filterArr, setFilterArr] = useState([])\n\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n const filter = (registration) => {\n if (searchTerm !== '') {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n if (!modelName.includes(searchTerm.toLowerCase())) {\n return false\n }\n }\n\n if (completeDeleteArr.includes(registration.model_name)) {\n registration.cache_status = Array.isArray(registration.cache_status)\n ? [false]\n : false\n }\n\n if (filterArr.length === 1) {\n if (filterArr[0] === 'cached') {\n return (\n registration.cache_status &&\n !completeDeleteArr.includes(registration.model_name)\n )\n } else {\n return collectionArr?.includes(registration.model_name)\n }\n } else if (filterArr.length > 1) {\n return (\n registration.cache_status &&\n !completeDeleteArr.includes(registration.model_name) &&\n collectionArr?.includes(registration.model_name)\n )\n }\n\n return true\n }\n\n const handleCompleteDelete = (model_name) => {\n setCompleteDeleteArr([...completeDeleteArr, model_name])\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 const collectionData = JSON.parse(localStorage.getItem('collectionArr'))\n setCollectionArr(collectionData)\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [])\n\n const getCollectionArr = (data) => {\n setCollectionArr(data)\n }\n\n const handleChangeFilter = (value) => {\n setStatus(value)\n const arr = [\n ...filterArr.filter((item) => {\n return item !== value\n }),\n value,\n ]\n setFilterArr(arr)\n }\n\n const handleDeleteChip = (item) => {\n setFilterArr(\n filterArr.filter((subItem) => {\n return subItem !== item\n })\n )\n\n if (item === status) setStatus('')\n }\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '150px 1fr',\n columnGap: '20px',\n margin: '30px 2rem',\n }}\n >\n <FormControl sx={{ marginTop: 2, minWidth: 120 }} size=\"small\">\n <InputLabel id=\"select-status\">Status</InputLabel>\n <Select\n id=\"status\"\n labelId=\"select-status\"\n label=\"Status\"\n onChange={(e) => handleChangeFilter(e.target.value)}\n value={status}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"cached\">cached</MenuItem>\n <MenuItem value=\"favorite\">favorite</MenuItem>\n </Select>\n </FormControl>\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={(e) => setSearchTerm(e.target.value)}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={{ margin: '0 0 30px 30px' }}>\n {filterArr.map((item, index) => (\n <Chip\n key={index}\n label={item}\n variant=\"outlined\"\n size=\"small\"\n color=\"primary\"\n style={{ marginRight: 10 }}\n onDelete={() => handleDeleteChip(item)}\n />\n ))}\n </div>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n gridGap: '2rem 0rem',\n }}\n >\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 gpuAvailable={gpuAvailable}\n onHandleCompleteDelete={handleCompleteDelete}\n onGetCollectionArr={getCollectionArr}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchModelComponent\n"],"mappings":"4kBAAA,OACEA,GAAG,CACHC,IAAI,CACJC,WAAW,CACXC,UAAU,CACVC,QAAQ,CACRC,MAAM,KACD,eAAe,CACtB,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAE9D,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,GAAM,CAAAC,oBAAoB,CAAG,QAAvB,CAAAA,oBAAoBA,CAAAC,IAAA,CAAoC,IAA9B,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAEC,YAAY,CAAAF,IAAA,CAAZ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":null,"code":"import _classCallCheck from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createClass.js\";import _inherits from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/inherits.js\";import _createSuper from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/createSuper.js\";import Table from'@mui/material/Table';import TableBody from'@mui/material/TableBody';import TableHead from'@mui/material/TableHead';import TableRow from'@mui/material/TableRow';import Grid from'@mui/material/Unstable_Grid2';import React from'react';import fetcher from'../../components/fetcher';import{toReadableSize}from'../../components/utils';import{StyledTableCell,StyledTableRow}from'./style';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var NodeInfo=/*#__PURE__*/function(_React$Component){_inherits(NodeInfo,_React$Component);var _super=_createSuper(NodeInfo);function NodeInfo(props){var _this;_classCallCheck(this,NodeInfo);_this=_super.call(this,props);_this.nodeRole=props.nodeRole;_this.endpoint=props.endpoint;_this.state={version:{},info:[]};return _this;}_createClass(NodeInfo,[{key:\"refreshInfo\",value:function refreshInfo(){var _this2=this;fetcher(\"\".concat(this.endpoint,\"/v1/cluster/info?detailed=true\"),{method:'GET'}).then(function(res){if(!res.ok){res.json().then(function(errorData){if(errorData.detail==='Not enough permissions'){console.log('Not enough permissions');// window.history.back();\n}});}if(res.ok){res.json().then(function(data){var state=_this2.state;state['info']=data;_this2.setState(state);});}}).catch(function(err){console.error('Error:',err);});if(JSON.stringify(this.state.version)==='{}'){fetcher(\"\".concat(this.endpoint,\"/v1/cluster/version\"),{method:'GET'}).then(function(res){if(res.ok){res.json().then(function(data){var state=_this2.state;state['version']={release:'v'+data['version'],commit:data['full-revisionid']};_this2.setState(state);});}}).catch(function(err){console.error('Error:',err);});}}},{key:\"componentDidMount\",value:function componentDidMount(){var _this3=this;this.interval=setInterval(function(){return _this3.refreshInfo();},5000);this.refreshInfo();}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){clearInterval(this.interval);}},{key:\"render\",value:function render(){var _this4=this;if(this.state===undefined||this.state['info']===[]){return/*#__PURE__*/_jsx(\"div\",{children:\"Loading\"});}if(this.nodeRole!=='Worker-Details'){var roleData=this.state['info'].filter(function(obj){return obj['node_type']===_this4.nodeRole;});var sum=function sum(arr){return arr.reduce(function(a,b){return a+b;},0);};var gatherResourceStats=function gatherResourceStats(prop){return sum(roleData.map(function(obj){return obj[prop];}));};var resourceStats={cpu_total:gatherResourceStats('cpu_count'),cpu_avail:gatherResourceStats('cpu_available'),memory_total:gatherResourceStats('mem_total'),memory_avail:gatherResourceStats('mem_available'),gpu_total:gatherResourceStats('gpu_count'),gpu_memory_total:gatherResourceStats('gpu_vram_total'),gpu_memory_avail:gatherResourceStats('gpu_vram_available')};//for all cases, we will at least have cpu information available.\nresourceStats.cpu_used=resourceStats.cpu_total-resourceStats.cpu_avail;resourceStats.memory_used=resourceStats.memory_total-resourceStats.memory_avail;var row_count=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Count\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:roleData.length})})})]});var CPU_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"CPU Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Usage: \",resourceStats.cpu_used.toFixed(2)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Total: \",resourceStats.cpu_total.toFixed(2)]})]})})]});var CPU_Memory_Info_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"CPU Memory Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Usage: \",toReadableSize(resourceStats.memory_used)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Total: \",toReadableSize(resourceStats.memory_total)]})]})})]});var version_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Version\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Release: \",this.state.version.release]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Commit: \",this.state.version.commit]})]})})]});var table_bodies;//case that we do not have GPU presents.\nif(resourceStats.gpu_memory_total===0){table_bodies=[row_count,CPU_row,CPU_Memory_Info_row,version_row];}else{resourceStats.gpu_memory_used=resourceStats.gpu_memory_total-resourceStats.gpu_memory_avail;var GPU_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"GPU Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsxs(Grid,{xs:12,children:[\"Total: \",resourceStats.gpu_total.toFixed(2)]})})})]});var GPU_Memory_Info_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"GPU Memory Info\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsxs(Grid,{container:true,children:[/*#__PURE__*/_jsxs(Grid,{xs:4,children:[\"Usage: \",toReadableSize(resourceStats.gpu_memory_used)]}),/*#__PURE__*/_jsxs(Grid,{xs:8,children:[\"Total: \",toReadableSize(resourceStats.gpu_memory_total)]})]})})]});table_bodies=[row_count,CPU_row,CPU_Memory_Info_row,GPU_row,GPU_Memory_Info_row,version_row];}if(this.nodeRole==='Supervisor'){var supervisor_addr_row=/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Address\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:roleData[0]?roleData[0]['ip_address']:'-'})})})]});table_bodies.splice(1,0,supervisor_addr_row);}return/*#__PURE__*/_jsxs(Table,{size:\"small\",children:[/*#__PURE__*/_jsx(TableHead,{children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Item\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:/*#__PURE__*/_jsx(Grid,{container:true,children:/*#__PURE__*/_jsx(Grid,{children:\"Value\"})})})]})}),/*#__PURE__*/_jsx(TableBody,{children:table_bodies})]});}else{var workerData=this.state['info'].filter(function(obj){return obj['node_type']==='Worker';});return/*#__PURE__*/_jsxs(Table,{size:\"small\",children:[/*#__PURE__*/_jsx(TableHead,{children:/*#__PURE__*/_jsxs(TableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Node Type\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Address\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"CPU Usage\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"CPU Total\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Mem Usage\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"Mem Total\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"GPU Count\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"GPU Mem Usage\"}),/*#__PURE__*/_jsx(StyledTableCell,{style:{fontWeight:'bolder'},children:\"GPU Mem Total\"})]})}),/*#__PURE__*/_jsx(TableBody,{children:workerData.map(function(row){return/*#__PURE__*/_jsxs(StyledTableRow,{children:[/*#__PURE__*/_jsx(StyledTableCell,{children:\"Worker\"}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['ip_address']}),/*#__PURE__*/_jsx(StyledTableCell,{children:(row['cpu_count']-row['cpu_available']).toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['cpu_count'].toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['mem_total']-row['mem_available'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['mem_total'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:row['gpu_count'].toFixed(2)}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['gpu_vram_total']-row['gpu_vram_available'])}),/*#__PURE__*/_jsx(StyledTableCell,{children:toReadableSize(row['gpu_vram_total'])})]});})})]});}}}]);return NodeInfo;}(React.Component);export default NodeInfo;","map":{"version":3,"names":["Table","TableBody","TableHead","TableRow","Grid","React","fetcher","toReadableSize","StyledTableCell","StyledTableRow","jsx","_jsx","jsxs","_jsxs","NodeInfo","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","nodeRole","endpoint","state","version","info","_createClass","key","value","refreshInfo","_this2","concat","method","then","res","ok","json","errorData","detail","console","log","data","setState","catch","err","error","JSON","stringify","release","commit","componentDidMount","_this3","interval","setInterval","componentWillUnmount","clearInterval","render","_this4","undefined","children","roleData","filter","obj","sum","arr","reduce","a","b","gatherResourceStats","prop","map","resourceStats","cpu_total","cpu_avail","memory_total","memory_avail","gpu_total","gpu_memory_total","gpu_memory_avail","cpu_used","memory_used","row_count","container","length","CPU_row","xs","toFixed","CPU_Memory_Info_row","version_row","table_bodies","gpu_memory_used","GPU_row","GPU_Memory_Info_row","supervisor_addr_row","splice","size","style","fontWeight","workerData","row","Component"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/cluster_info/nodeInfo.js"],"sourcesContent":["import Table from '@mui/material/Table'\nimport TableBody from '@mui/material/TableBody'\nimport TableHead from '@mui/material/TableHead'\nimport TableRow from '@mui/material/TableRow'\nimport Grid from '@mui/material/Unstable_Grid2'\nimport PropTypes from 'prop-types'\nimport React from 'react'\n\nimport fetcher from '../../components/fetcher'\nimport { toReadableSize } from '../../components/utils'\nimport { StyledTableCell, StyledTableRow } from './style'\n\nclass NodeInfo extends React.Component {\n constructor(props) {\n super(props)\n this.nodeRole = props.nodeRole\n this.endpoint = props.endpoint\n this.state = {\n version: {},\n info: [],\n }\n }\n\n refreshInfo() {\n fetcher(`${this.endpoint}/v1/cluster/info?detailed=true`, { method: 'GET' })\n .then((res) => {\n if (!res.ok) {\n res.json().then((errorData) => {\n if (errorData.detail === 'Not enough permissions') {\n console.log('Not enough permissions')\n // window.history.back();\n }\n })\n }\n if (res.ok) {\n res.json().then((data) => {\n const { state } = this\n state['info'] = data\n this.setState(state)\n })\n }\n })\n .catch((err) => {\n console.error('Error:', err)\n })\n\n if (JSON.stringify(this.state.version) === '{}') {\n fetcher(`${this.endpoint}/v1/cluster/version`, {\n method: 'GET',\n })\n .then((res) => {\n if (res.ok) {\n res.json().then((data) => {\n const { state } = this\n state['version'] = {\n release: 'v' + data['version'],\n commit: data['full-revisionid'],\n }\n this.setState(state)\n })\n }\n })\n .catch((err) => {\n console.error('Error:', err)\n })\n }\n }\n\n componentDidMount() {\n this.interval = setInterval(() => this.refreshInfo(), 5000)\n this.refreshInfo()\n }\n\n componentWillUnmount() {\n clearInterval(this.interval)\n }\n\n render() {\n if (this.state === undefined || this.state['info'] === []) {\n return <div>Loading</div>\n }\n\n if (this.nodeRole !== 'Worker-Details') {\n const roleData = this.state['info'].filter(\n (obj) => obj['node_type'] === this.nodeRole\n )\n\n const sum = (arr) => {\n return arr.reduce((a, b) => a + b, 0)\n }\n\n const gatherResourceStats = (prop) =>\n sum(roleData.map((obj) => obj[prop]))\n\n const resourceStats = {\n cpu_total: gatherResourceStats('cpu_count'),\n cpu_avail: gatherResourceStats('cpu_available'),\n memory_total: gatherResourceStats('mem_total'),\n memory_avail: gatherResourceStats('mem_available'),\n gpu_total: gatherResourceStats('gpu_count'),\n gpu_memory_total: gatherResourceStats('gpu_vram_total'),\n gpu_memory_avail: gatherResourceStats('gpu_vram_available'),\n }\n\n //for all cases, we will at least have cpu information available.\n resourceStats.cpu_used = resourceStats.cpu_total - resourceStats.cpu_avail\n resourceStats.memory_used =\n resourceStats.memory_total - resourceStats.memory_avail\n\n const row_count = (\n <StyledTableRow>\n <StyledTableCell>Count</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid>{roleData.length}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const CPU_row = (\n <StyledTableRow>\n <StyledTableCell>CPU Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>Usage: {resourceStats.cpu_used.toFixed(2)}</Grid>\n <Grid xs={8}>Total: {resourceStats.cpu_total.toFixed(2)}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const CPU_Memory_Info_row = (\n <StyledTableRow>\n <StyledTableCell>CPU Memory Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n Usage: {toReadableSize(resourceStats.memory_used)}\n </Grid>\n <Grid xs={8}>\n Total: {toReadableSize(resourceStats.memory_total)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const version_row = (\n <StyledTableRow>\n <StyledTableCell>Version</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>Release: {this.state.version.release}</Grid>\n <Grid xs={8}>Commit: {this.state.version.commit}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n let table_bodies\n //case that we do not have GPU presents.\n if (resourceStats.gpu_memory_total === 0) {\n table_bodies = [row_count, CPU_row, CPU_Memory_Info_row, version_row]\n } else {\n resourceStats.gpu_memory_used =\n resourceStats.gpu_memory_total - resourceStats.gpu_memory_avail\n\n const GPU_row = (\n <StyledTableRow>\n <StyledTableCell>GPU Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={12}>Total: {resourceStats.gpu_total.toFixed(2)}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n const GPU_Memory_Info_row = (\n <StyledTableRow>\n <StyledTableCell>GPU Memory Info</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid xs={4}>\n Usage: {toReadableSize(resourceStats.gpu_memory_used)}\n </Grid>\n <Grid xs={8}>\n Total: {toReadableSize(resourceStats.gpu_memory_total)}\n </Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n\n table_bodies = [\n row_count,\n CPU_row,\n CPU_Memory_Info_row,\n GPU_row,\n GPU_Memory_Info_row,\n version_row,\n ]\n }\n\n if (this.nodeRole === 'Supervisor') {\n const supervisor_addr_row = (\n <StyledTableRow>\n <StyledTableCell>Address</StyledTableCell>\n <StyledTableCell>\n <Grid container>\n <Grid>{roleData[0] ? roleData[0]['ip_address'] : '-'}</Grid>\n </Grid>\n </StyledTableCell>\n </StyledTableRow>\n )\n table_bodies.splice(1, 0, supervisor_addr_row)\n }\n\n return (\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Item\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n <Grid container>\n <Grid>Value</Grid>\n </Grid>\n </StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>{table_bodies}</TableBody>\n </Table>\n )\n } else {\n const workerData = this.state['info'].filter(\n (obj) => obj['node_type'] === 'Worker'\n )\n\n return (\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Node Type\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Address\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n CPU Usage\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n CPU Total\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Mem Usage\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n Mem Total\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n GPU Count\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n GPU Mem Usage\n </StyledTableCell>\n <StyledTableCell style={{ fontWeight: 'bolder' }}>\n GPU Mem Total\n </StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {workerData.map((row) => (\n <StyledTableRow>\n <StyledTableCell>Worker</StyledTableCell>\n <StyledTableCell>{row['ip_address']}</StyledTableCell>\n <StyledTableCell>\n {(row['cpu_count'] - row['cpu_available']).toFixed(2)}\n </StyledTableCell>\n <StyledTableCell>{row['cpu_count'].toFixed(2)}</StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['mem_total'] - row['mem_available'])}\n </StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['mem_total'])}\n </StyledTableCell>\n <StyledTableCell>{row['gpu_count'].toFixed(2)}</StyledTableCell>\n <StyledTableCell>\n {toReadableSize(\n row['gpu_vram_total'] - row['gpu_vram_available']\n )}\n </StyledTableCell>\n <StyledTableCell>\n {toReadableSize(row['gpu_vram_total'])}\n </StyledTableCell>\n </StyledTableRow>\n ))}\n </TableBody>\n </Table>\n )\n }\n }\n}\n\nNodeInfo.propTypes = {\n nodeRole: PropTypes.string,\n endpoint: PropTypes.string,\n}\n\nexport default NodeInfo\n"],"mappings":"oiBAAA,MAAO,CAAAA,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,C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AC,CAAC,CACvB,CAAC,EACJ,CAAC,EAClB,CAAC,CACO,CAAC,EACP,CAAC,CAEZ,CACF,CAAC,WAAAvF,QAAA,GApSoBT,KAAK,CAACiG,SAAS,EA4StC,cAAe,CAAAxF,QAAQ","ignoreList":[]},"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,{useEffect}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import Title from'../../components/Title';import RegisterModelComponent from'./registerModel';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var RegisterModel=function RegisterModel(){var _React$useState=React.useState(sessionStorage.getItem('registerModelType')?sessionStorage.getItem('registerModelType'):'/register_model/llm'),_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();useEffect(function(){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token!=='no_auth'&&!sessionStorage.getItem('token')){navigate('/login',{replace:true});return;}},[cookie.token]);var handleTabChange=function handleTabChange(_,newValue){setTabValue(newValue);navigate(newValue);sessionStorage.setItem('registerModelType',newValue);};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",style:{overflow:'hidden'},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:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Model\",value:\"/register_model/llm\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Model\",value:\"/register_model/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Model\",value:\"/register_model/rerank\"}),/*#__PURE__*/_jsx(Tab,{label:\"Image Model\",value:\"/register_model/image\"}),/*#__PURE__*/_jsx(Tab,{label:\"Audio Model\",value:\"/register_model/audio\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"LLM\",customData:{version:1,model_name:'custom-llm',model_description:'This is a custom model description.',context_length:2048,model_lang:['en'],model_ability:['generate'],model_family:'',model_specs:[{model_uri:'/path/to/llama-1',model_size_in_billions:7,model_format:'pytorch',quantizations:['none']}],prompt_style:undefined}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/embedding\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"embedding\",customData:{model_name:'custom-embedding',dimensions:768,max_tokens:512,model_uri:'/path/to/embedding-model',language:['en']}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"rerank\",customData:{model_name:'custom-rerank',model_uri:'/path/to/rerank-model',language:['en']}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/image\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"image\",customData:{model_name:'custom-image',model_uri:'/path/to/image-model',model_family:'stable_diffusion',controlnet:[]}})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/register_model/audio\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterModelComponent,{modelType:\"audio\",customData:{model_name:'custom-audio',model_uri:'/path/to/audio-model',multilingual:false,model_family:'whisper'}})})]})]});};export default RegisterModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","useEffect","useCookies","useNavigate","ErrorMessageSnackBar","Title","RegisterModelComponent","jsx","_jsx","jsxs","_jsxs","RegisterModel","_React$useState","useState","sessionStorage","getItem","_React$useState2","_slicedToArray","tabValue","setTabValue","_useCookies","_useCookies2","cookie","navigate","token","undefined","replace","handleTabChange","_","newValue","setItem","m","style","overflow","children","title","value","sx","borderBottom","borderColor","onChange","label","padding","modelType","customData","version","model_name","model_description","context_length","model_lang","model_ability","model_family","model_specs","model_uri","model_size_in_billions","model_format","quantizations","prompt_style","dimensions","max_tokens","language","controlnet","multilingual"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Tab } from '@mui/material'\nimport React, { useEffect } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport Title from '../../components/Title'\nimport RegisterModelComponent from './registerModel'\n\nconst RegisterModel = () => {\n const [tabValue, setTabValue] = React.useState(\n sessionStorage.getItem('registerModelType')\n ? sessionStorage.getItem('registerModelType')\n : '/register_model/llm'\n )\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\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 }, [cookie.token])\n\n const handleTabChange = (_, newValue) => {\n setTabValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('registerModelType', newValue)\n }\n\n return (\n <Box m=\"20px\" style={{ overflow: 'hidden' }}>\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={handleTabChange}\n aria-label=\"tabs\"\n >\n <Tab label=\"Language Model\" value=\"/register_model/llm\" />\n <Tab label=\"Embedding Model\" value=\"/register_model/embedding\" />\n <Tab label=\"Rerank Model\" value=\"/register_model/rerank\" />\n <Tab label=\"Image Model\" value=\"/register_model/image\" />\n <Tab label=\"Audio Model\" value=\"/register_model/audio\" />\n </TabList>\n </Box>\n <TabPanel value=\"/register_model/llm\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"LLM\"\n customData={{\n version: 1,\n model_name: 'custom-llm',\n model_description: 'This is a custom model description.',\n context_length: 2048,\n model_lang: ['en'],\n model_ability: ['generate'],\n model_family: '',\n model_specs: [\n {\n model_uri: '/path/to/llama-1',\n model_size_in_billions: 7,\n model_format: 'pytorch',\n quantizations: ['none'],\n },\n ],\n prompt_style: undefined,\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/embedding\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"embedding\"\n customData={{\n model_name: 'custom-embedding',\n dimensions: 768,\n max_tokens: 512,\n model_uri: '/path/to/embedding-model',\n language: ['en'],\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/rerank\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"rerank\"\n customData={{\n model_name: 'custom-rerank',\n model_uri: '/path/to/rerank-model',\n language: ['en'],\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/image\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"image\"\n customData={{\n model_name: 'custom-image',\n model_uri: '/path/to/image-model',\n model_family: 'stable_diffusion',\n controlnet: [],\n }}\n />\n </TabPanel>\n <TabPanel value=\"/register_model/audio\" sx={{ padding: 0 }}>\n <RegisterModelComponent\n modelType=\"audio\"\n customData={{\n model_name: 'custom-audio',\n model_uri: '/path/to/audio-model',\n multilingual: false,\n model_family: 'whisper',\n }}\n />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RegisterModel\n"],"mappings":"6IAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,U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AC,IAAI,CACjB,CAAE,CACH,CAAC,CACM,CAAC,cACXpD,IAAA,CAACX,QAAQ,EAACuC,KAAK,CAAC,uBAAuB,CAACC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAR,QAAA,cACzD1B,IAAA,CAACF,sBAAsB,EACrBqC,SAAS,CAAC,OAAO,CACjBC,UAAU,CAAE,CACVE,UAAU,CAAE,cAAc,CAC1BO,SAAS,CAAE,sBAAsB,CACjCF,YAAY,CAAE,kBAAkB,CAChCU,UAAU,CAAE,EACd,CAAE,CACH,CAAC,CACM,CAAC,cACXrD,IAAA,CAACX,QAAQ,EAACuC,KAAK,CAAC,uBAAuB,CAACC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAR,QAAA,cACzD1B,IAAA,CAACF,sBAAsB,EACrBqC,SAAS,CAAC,OAAO,CACjBC,UAAU,CAAE,CACVE,UAAU,CAAE,cAAc,CAC1BO,SAAS,CAAE,sBAAsB,CACjCS,YAAY,CAAE,KAAK,CACnBX,YAAY,CAAE,SAChB,CAAE,CACH,CAAC,CACM,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAxC,aAAa","ignoreList":[]},"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 ExitToAppIcon from'@mui/icons-material/ExitToApp';import{Box,Stack,Typography}from'@mui/material';import Button from'@mui/material/Button';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{isValidBearerToken}from'./utils';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var Title=function Title(_ref){var title=_ref.title;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,3),cookie=_useCookies2[0],removeCookie=_useCookies2[2];var navigate=useNavigate();var handleLogout=function handleLogout(){removeCookie('token',{path:'/'});sessionStorage.removeItem('token');navigate('/login',{replace:true});};return/*#__PURE__*/_jsx(Box,{mb:\"30px\",children:/*#__PURE__*/_jsxs(Stack,{direction:\"row\",alignItems:\"center\",justifyContent:\"space-between\",children:[/*#__PURE__*/_jsx(Typography,{variant:\"h2\",color:\"#141414\",fontWeight:\"bold\",sx:{m:'0 0 5px 0'},children:title}),isValidBearerToken(cookie.token)&&/*#__PURE__*/_jsx(Button,{variant:\"outlined\",size:\"large\",onClick:handleLogout,startIcon:/*#__PURE__*/_jsx(ExitToAppIcon,{}),children:\"LOG OUT\"})]})});};export default Title;","map":{"version":3,"names":["ExitToAppIcon","Box","Stack","Typography","Button","useCookies","useNavigate","isValidBearerToken","jsx","_jsx","jsxs","_jsxs","Title","_ref","title","_useCookies","_useCookies2","_slicedToArray","cookie","removeCookie","navigate","handleLogout","path","sessionStorage","removeItem","replace","mb","children","direction","alignItems","justifyContent","variant","color","fontWeight","sx","m","token","size","onClick","startIcon"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/Title.js"],"sourcesContent":["import ExitToAppIcon from '@mui/icons-material/ExitToApp'\nimport { Box, Stack, Typography } from '@mui/material'\nimport Button from '@mui/material/Button'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { isValidBearerToken } from './utils'\n\nconst Title = ({ title }) => {\n const [cookie, , removeCookie] = useCookies(['token'])\n const navigate = useNavigate()\n\n const handleLogout = () => {\n removeCookie('token', { path: '/' })\n sessionStorage.removeItem('token')\n navigate('/login', { replace: true })\n }\n\n return (\n <Box mb=\"30px\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Typography\n variant=\"h2\"\n color=\"#141414\"\n fontWeight=\"bold\"\n sx={{ m: '0 0 5px 0' }}\n >\n {title}\n </Typography>\n {isValidBearerToken(cookie.token) && (\n <Button\n variant=\"outlined\"\n size=\"large\"\n onClick={handleLogout}\n startIcon={<ExitToAppIcon />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,MAAM,CACjBC,EAAE,CAAE,CAAEC,CAAC,CAAE,WAAY,CAAE,CAAAR,QAAA,CAEtBb,KAAK,CACI,CAAC,CACZP,kBAAkB,CAACW,MAAM,CAACkB,KAAK,CAAC,eAC/B3B,IAAA,CAACL,MAAM,EACL2B,OAAO,CAAC,UAAU,CAClBM,IAAI,CAAC,OAAO,CACZC,OAAO,CAAEjB,YAAa,CACtBkB,SAAS,cAAE9B,IAAA,CAACT,aAAa,GAAE,CAAE,CAAA2B,QAAA,CAC9B,SAED,CAAQ,CACT,EACI,CAAC,CACL,CAAC,CAEV,CAAC,CAED,cAAe,CAAAf,KAAK","ignoreList":[]},"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 fetcher from'../../components/fetcher';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){fetcher(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',gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'rerank',gpuAvailable:gpuAvailable})}),/*#__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","fetcher","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","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 fetcher from '../../components/fetcher'\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 fetcher(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\n modelType={'embedding'}\n gpuAvailable={gpuAvailable}\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/rerank\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'rerank'}\n gpuAvailable={gpuAvailable}\n />\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,OAAO,KAAM,0BAA0B,CAC9C,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,IA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Y,CAAEA,YAAa,CAC5B,CAAC,CACM,CAAC,cACXd,IAAA,CAACjB,QAAQ,EAAC2B,KAAK,CAAC,sBAAsB,CAACkC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACxD1C,IAAA,CAACF,oBAAoB,EACnBoD,SAAS,CAAE,QAAS,CACpBpC,YAAY,CAAEA,YAAa,CAC5B,CAAC,CACM,CAAC,cACXd,IAAA,CAACjB,QAAQ,EAAC2B,KAAK,CAAC,qBAAqB,CAACkC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACvD1C,IAAA,CAACF,oBAAoB,EAACoD,SAAS,CAAE,OAAQ,CAAE,CAAC,CACpC,CAAC,cACXlD,IAAA,CAACjB,QAAQ,EAAC2B,KAAK,CAAC,qBAAqB,CAACkC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACvD1C,IAAA,CAACF,oBAAoB,EAACoD,SAAS,CAAE,OAAQ,CAAE,CAAC,CACpC,CAAC,cACXlD,IAAA,CAACjB,QAAQ,EAAC2B,KAAK,CAAC,0BAA0B,CAACkC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cAC5D1C,IAAA,CAACJ,YAAY,EAACkB,YAAY,CAAEA,YAAa,CAAE,CAAC,CACpC,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAX,WAAW","ignoreList":[]},"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{CssBaseline,ThemeProvider}from'@mui/material';import Snackbar from'@mui/material/Snackbar';import React,{useEffect,useState}from'react';import{useCookies}from'react-cookie';import{HashRouter}from'react-router-dom';import{Alert}from'./components/alertComponent';import{ApiContextProvider}from'./components/apiContext';import AuthAlertDialog from'./components/authAlertDialog';import{getEndpoint}from'./components/utils';import WraperRoutes from'./router/index';import{useMode}from'./theme';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";function App(){var _useMode=useMode(),_useMode2=_slicedToArray(_useMode,1),theme=_useMode2[0];var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,3),cookie=_useCookies2[0],setCookie=_useCookies2[1],removeCookie=_useCookies2[2];var _useState=useState(''),_useState2=_slicedToArray(_useState,2),msg=_useState2[0],setMsg=_useState2[1];var endPoint=getEndpoint();useEffect(function(){// token possible value: no_auth / need_auth / <real bearer token>\nfetch(endPoint+'/v1/cluster/auth',{method:'GET',headers:{'Content-Type':'application/json'}}).then(function(res){if(!res.ok){res.json().then(function(errorData){setMsg(\"Server error: \".concat(res.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{res.json().then(function(data){if(!data.auth&&cookie.token!=='no_auth'){setCookie('token','no_auth',{path:'/'});}else if(data.auth&&!sessionStorage.getItem('token')){removeCookie('token',{path:'/'});}});}});},[]);var handleClose=function handleClose(event,reason){if(reason==='clickaway'){return;}setMsg('');};return/*#__PURE__*/_jsxs(\"div\",{className:\"app\",children:[/*#__PURE__*/_jsx(Snackbar,{open:msg!=='',autoHideDuration:10000,anchorOrigin:{vertical:'top',horizontal:'center'},onClose:handleClose,children:/*#__PURE__*/_jsx(Alert,{severity:\"error\",onClose:handleClose,sx:{width:'100%'},children:msg})}),/*#__PURE__*/_jsx(HashRouter,{children:/*#__PURE__*/_jsx(ThemeProvider,{theme:theme,children:/*#__PURE__*/_jsxs(ApiContextProvider,{children:[/*#__PURE__*/_jsx(CssBaseline,{}),/*#__PURE__*/_jsx(AuthAlertDialog,{}),/*#__PURE__*/_jsx(WraperRoutes,{})]})})})]});}export default App;","map":{"version":3,"names":["CssBaseline","ThemeProvider","Snackbar","React","useEffect","useState","useCookies","HashRouter","Alert","ApiContextProvider","AuthAlertDialog","getEndpoint","WraperRoutes","useMode","jsx","_jsx","jsxs","_jsxs","App","_useMode","_useMode2","_slicedToArray","theme","_useCookies","_useCookies2","cookie","setCookie","removeCookie","_useState","_useState2","msg","setMsg","endPoint","fetch","method","headers","then","res","ok","json","errorData","concat","status","detail","data","auth","token","path","sessionStorage","getItem","handleClose","event","reason","className","children","open","autoHideDuration","anchorOrigin","vertical","horizontal","onClose","severity","sx","width"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/App.js"],"sourcesContent":["import { CssBaseline, ThemeProvider } from '@mui/material'\nimport Snackbar from '@mui/material/Snackbar'\nimport React, { useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { HashRouter } from 'react-router-dom'\n\nimport { Alert } from './components/alertComponent'\nimport { ApiContextProvider } from './components/apiContext'\nimport AuthAlertDialog from './components/authAlertDialog'\nimport { getEndpoint } from './components/utils'\nimport WraperRoutes from './router/index'\nimport { useMode } from './theme'\n\nfunction App() {\n const [theme] = useMode()\n const [cookie, setCookie, removeCookie] = useCookies(['token'])\n const [msg, setMsg] = useState('')\n\n const endPoint = getEndpoint()\n\n useEffect(() => {\n // token possible value: no_auth / need_auth / <real bearer token>\n fetch(endPoint + '/v1/cluster/auth', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((res) => {\n if (!res.ok) {\n res.json().then((errorData) => {\n setMsg(\n `Server error: ${res.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n res.json().then((data) => {\n if (!data.auth && cookie.token !== 'no_auth') {\n setCookie('token', 'no_auth', { path: '/' })\n } else if (data.auth && !sessionStorage.getItem('token')) {\n removeCookie('token', { path: '/' })\n }\n })\n }\n })\n }, [])\n\n const handleClose = (event, reason) => {\n if (reason === 'clickaway') {\n return\n }\n setMsg('')\n }\n\n return (\n <div className=\"app\">\n <Snackbar\n open={msg !== ''}\n autoHideDuration={10000}\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n onClose={handleClose}\n >\n <Alert severity=\"error\" onClose={handleClose} sx={{ width: '100%' }}>\n {msg}\n </Alert>\n </Snackbar>\n <HashRouter>\n <ThemeProvider theme={theme}>\n <ApiContextProvider>\n <CssBaseline />\n <AuthAlertDialog />\n <WraperRoutes />\n </ApiContextProvider>\n </ThemeProvider>\n </HashRouter>\n </div>\n )\n}\n\nexport default App\n"],"mappings":"6IAAA,OAASA,WAAW,CAAEC,aAAa,KAAQ,eAAe,CAC1D,MAAO,CAAAC,QAAQ,KAAM,wBAAwB,CAC7C,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAClD,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,UAAU,KAAQ,kBAAkB,CAE7C,OAASC,KAAK,KAAQ,6BAA6B,CACnD,OAASC,kBAAkB,KAAQ,yBAAyB,CAC5D,MAAO,CAAAC,eAAe,KAAM,8BAA8B,CAC1D,OAASC,WAAW,KAAQ,oBAAoB,CAChD,MAAO,CAAAC,YAAY,KAAM,gBAAgB,CACzC,OAASC,OAAO,KAAQ,SAAS,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEjC,QAAS,CAAAC,GAAGA,CAAA,CAAG,CACb,IAAAC,QAAA,CAAgBN,OAAO,CAAC,CAAC,CAAAO,SAAA,CAAAC,cAAA,CAAAF,QAAA,IAAlBG,KAAK,CAAAF,SAAA,IACZ,IAAAG,WAAA,CAA0CjB,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAAkB,YAAA,CAAAH,cAAA,CAAAE,WAAA,IAAxDE,MAAM,CAAAD,YAAA,IAAEE,SAAS,CAAAF,YAAA,IAAEG,YAAY,CAAAH,YAAA,IACtC,IAAAI,SAAA,CAAsBvB,QAAQ,CAAC,EAAE,CAAC,CAAAwB,UAAA,CAAAR,cAAA,CAAAO,SAAA,IAA3BE,GAAG,CAAAD,UAAA,IAAEE,MAAM,CAAAF,UAAA,IAElB,GAAM,CAAAG,QAAQ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QAAQ,EACPqD,IAAI,CAAEzB,GAAG,GAAK,EAAG,CACjB0B,gBAAgB,CAAE,KAAM,CACxBC,YAAY,CAAE,CAAEC,QAAQ,CAAE,KAAK,CAAEC,UAAU,CAAE,QAAS,CAAE,CACxDC,OAAO,CAAEV,WAAY,CAAAI,QAAA,cAErBvC,IAAA,CAACP,KAAK,EAACqD,QAAQ,CAAC,OAAO,CAACD,OAAO,CAAEV,WAAY,CAACY,EAAE,CAAE,CAAEC,KAAK,CAAE,MAAO,CAAE,CAAAT,QAAA,CACjExB,GAAG,CACC,CAAC,CACA,CAAC,cACXf,IAAA,CAACR,UAAU,EAAA+C,QAAA,cACTvC,IAAA,CAACd,aAAa,EAACqB,KAAK,CAAEA,KAAM,CAAAgC,QAAA,cAC1BrC,KAAA,CAACR,kBAAkB,EAAA6C,QAAA,eACjBvC,IAAA,CAACf,WAAW,GAAE,CAAC,cACfe,IAAA,CAACL,eAAe,GAAE,CAAC,cACnBK,IAAA,CAACH,YAAY,GAAE,CAAC,EACE,CAAC,CACR,CAAC,CACN,CAAC,EACV,CAAC,CAEV,CAEA,cAAe,CAAAM,GAAG","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _defineProperty from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{AddBoxOutlined,ChevronRightOutlined,DnsOutlined,GitHub,RocketLaunchOutlined,SmartToyOutlined}from'@mui/icons-material';import{Box,Drawer,List,ListItem,ListItemButton,ListItemIcon,ListItemText,Typography,useTheme}from'@mui/material';import{useEffect,useState}from'react';import{useLocation,useNavigate}from'react-router-dom';import icon from'../media/icon.webp';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var navItems=[{text:'Launch Model',icon:/*#__PURE__*/_jsx(RocketLaunchOutlined,{})},{text:'Running Models',icon:/*#__PURE__*/_jsx(SmartToyOutlined,{})},{text:'Register Model',icon:/*#__PURE__*/_jsx(AddBoxOutlined,{})},{text:'Cluster Information',icon:/*#__PURE__*/_jsx(DnsOutlined,{})},{text:'Contact Us',icon:/*#__PURE__*/_jsx(GitHub,{})}];var MenuSide=function MenuSide(){var theme=useTheme();var _useLocation=useLocation(),pathname=_useLocation.pathname;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),active=_useState2[0],setActive=_useState2[1];var navigate=useNavigate();var _useState3=useState(\"\".concat(Math.min(Math.max(window.innerWidth*0.2,287),320),\"px\")),_useState4=_slicedToArray(_useState3,2),drawerWidth=_useState4[0],setDrawerWidth=_useState4[1];useEffect(function(){setActive(pathname.substring(1));},[pathname]);useEffect(function(){var screenWidth=window.innerWidth;var maxDrawerWidth=Math.min(Math.max(screenWidth*0.2,287),320);setDrawerWidth(\"\".concat(maxDrawerWidth,\"px\"));// Update the drawer width on window resize\nvar handleResize=function handleResize(){var newScreenWidth=window.innerWidth;var newMaxDrawerWidth=Math.min(Math.max(newScreenWidth*0.2,287),320);setDrawerWidth(\"\".concat(newMaxDrawerWidth,\"px\"));};window.addEventListener('resize',handleResize);return function(){window.removeEventListener('resize',handleResize);};},[]);return/*#__PURE__*/_jsxs(Drawer,{variant:\"permanent\",sx:_objectSpread(_objectSpread({width:drawerWidth},theme.mixins.toolbar),{},_defineProperty({flexShrink:0},\"& .MuiDrawer-paper\",{width:drawerWidth,boxSizing:'border-box'})),children:[/*#__PURE__*/_jsx(Box,{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",width:\"100%\",children:/*#__PURE__*/_jsx(Box,{display:\"flex\",m:\"2rem 1rem 0rem 1rem\",width:\"217px\",children:/*#__PURE__*/_jsxs(Box,{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",textTransform:\"none\",children:[/*#__PURE__*/_jsx(Box,{component:\"img\",alt:\"profile\",src:icon,height:\"60px\",width:\"60px\",borderRadius:\"50%\",sx:{objectFit:'cover',mr:1.5}}),/*#__PURE__*/_jsx(Box,{textAlign:\"left\",children:/*#__PURE__*/_jsx(Typography,{fontWeight:\"bold\",fontSize:\"1.7rem\",children:'Xinference'})})]})})}),/*#__PURE__*/_jsx(Box,{children:/*#__PURE__*/_jsxs(Box,{width:\"100%\",children:[/*#__PURE__*/_jsx(Box,{m:\"1.5rem 2rem 2rem 3rem\"}),/*#__PURE__*/_jsx(List,{children:navItems.map(function(_ref){var text=_ref.text,icon=_ref.icon;if(!icon){return/*#__PURE__*/_jsx(Typography,{sx:{m:'2.25rem 0 1rem 3rem'},children:text},text);}var link=text.toLowerCase().replace(' ','_');return/*#__PURE__*/_jsx(ListItem,{children:/*#__PURE__*/_jsxs(ListItemButton,{onClick:function onClick(){if(link==='contact_us'){window.open('https://github.com/xorbitsai/inference','_blank','noreferrer');}else if(link==='launch_model'){sessionStorage.setItem('modelType','/launch_model/llm');navigate('/launch_model/llm');setActive(link);console.log(active);}else if(link==='cluster_information'){navigate('/cluster_info');setActive(link);}else if(link==='running_models'){navigate('/running_models/LLM');sessionStorage.setItem('runningModelType','/running_models/LLM');setActive(link);console.log(active);}else if(link==='register_model'){sessionStorage.setItem('registerModelType','/register_model/llm');navigate('/register_model/llm');setActive(link);console.log(active);}else{navigate(\"/\".concat(link));setActive(link);console.log(active);}},children:[/*#__PURE__*/_jsx(ListItemIcon,{sx:{ml:'2rem'},children:icon}),/*#__PURE__*/_jsx(ListItemText,{primary:text}),/*#__PURE__*/_jsx(ChevronRightOutlined,{sx:{ml:'auto'}})]})},text);})})]})})]});};export default MenuSide;","map":{"version":3,"names":["AddBoxOutlined","ChevronRightOutlined","DnsOutlined","GitHub","RocketLaunchOutlined","SmartToyOutlined","Box","Drawer","List","ListItem","ListItemButton","ListItemIcon","ListItemText","Typography","useTheme","useEffect","useState","useLocation","useNavigate","icon","jsx","_jsx","jsxs","_jsxs","navItems","text","MenuSide","theme","_useLocation","pathname","_useState","_useState2","_slicedToArray","active","setActive","navigate","_useState3","concat","Math","min","max","window","innerWidth","_useState4","drawerWidth","setDrawerWidth","substring","screenWidth","maxDrawerWidth","handleResize","newScreenWidth","newMaxDrawerWidth","addEventListener","removeEventListener","variant","sx","_objectSpread","width","mixins","toolbar","_defineProperty","flexShrink","boxSizing","children","display","justifyContent","alignItems","m","textTransform","component","alt","src","height","borderRadius","objectFit","mr","textAlign","fontWeight","fontSize","map","_ref","link","toLowerCase","replace","onClick","open","sessionStorage","setItem","console","log","ml","primary"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/MenuSide.js"],"sourcesContent":["import {\n AddBoxOutlined,\n ChevronRightOutlined,\n DnsOutlined,\n GitHub,\n RocketLaunchOutlined,\n SmartToyOutlined,\n} from '@mui/icons-material'\nimport {\n Box,\n Drawer,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Typography,\n useTheme,\n} from '@mui/material'\nimport { useEffect, useState } from 'react'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport icon from '../media/icon.webp'\n\nconst navItems = [\n {\n text: 'Launch Model',\n icon: <RocketLaunchOutlined />,\n },\n {\n text: 'Running Models',\n icon: <SmartToyOutlined />,\n },\n {\n text: 'Register Model',\n icon: <AddBoxOutlined />,\n },\n {\n text: 'Cluster Information',\n icon: <DnsOutlined />,\n },\n {\n text: 'Contact Us',\n icon: <GitHub />,\n },\n]\n\nconst MenuSide = () => {\n const theme = useTheme()\n const { pathname } = useLocation()\n const [active, setActive] = useState('')\n const navigate = useNavigate()\n const [drawerWidth, setDrawerWidth] = useState(\n `${Math.min(Math.max(window.innerWidth * 0.2, 287), 320)}px`\n )\n\n useEffect(() => {\n setActive(pathname.substring(1))\n }, [pathname])\n\n useEffect(() => {\n const screenWidth = window.innerWidth\n const maxDrawerWidth = Math.min(Math.max(screenWidth * 0.2, 287), 320)\n setDrawerWidth(`${maxDrawerWidth}px`)\n\n // Update the drawer width on window resize\n const handleResize = () => {\n const newScreenWidth = window.innerWidth\n const newMaxDrawerWidth = Math.min(\n Math.max(newScreenWidth * 0.2, 287),\n 320\n )\n setDrawerWidth(`${newMaxDrawerWidth}px`)\n }\n\n window.addEventListener('resize', handleResize)\n return () => {\n window.removeEventListener('resize', handleResize)\n }\n }, [])\n\n return (\n <Drawer\n variant=\"permanent\"\n sx={{\n width: drawerWidth,\n ...theme.mixins.toolbar,\n flexShrink: 0,\n [`& .MuiDrawer-paper`]: {\n width: drawerWidth,\n boxSizing: 'border-box',\n },\n }}\n >\n {/* Title */}\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n width=\"100%\"\n >\n <Box display=\"flex\" m=\"2rem 1rem 0rem 1rem\" width=\"217px\">\n <Box\n display=\"flex\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n textTransform=\"none\"\n >\n <Box\n component=\"img\"\n alt=\"profile\"\n src={icon}\n height=\"60px\"\n width=\"60px\"\n borderRadius=\"50%\"\n sx={{ objectFit: 'cover', mr: 1.5 }}\n />\n <Box textAlign=\"left\">\n <Typography fontWeight=\"bold\" fontSize=\"1.7rem\">\n {'Xinference'}\n </Typography>\n </Box>\n </Box>\n </Box>\n </Box>\n\n <Box>\n <Box width=\"100%\">\n <Box m=\"1.5rem 2rem 2rem 3rem\"></Box>\n <List>\n {navItems.map(({ text, icon }) => {\n if (!icon) {\n return (\n <Typography key={text} sx={{ m: '2.25rem 0 1rem 3rem' }}>\n {text}\n </Typography>\n )\n }\n\n const link = text.toLowerCase().replace(' ', '_')\n\n return (\n <ListItem key={text}>\n <ListItemButton\n onClick={() => {\n if (link === 'contact_us') {\n window.open(\n 'https://github.com/xorbitsai/inference',\n '_blank',\n 'noreferrer'\n )\n } else if (link === 'launch_model') {\n sessionStorage.setItem('modelType', '/launch_model/llm')\n navigate('/launch_model/llm')\n setActive(link)\n console.log(active)\n } else if (link === 'cluster_information') {\n navigate('/cluster_info')\n setActive(link)\n } else if (link === 'running_models') {\n navigate('/running_models/LLM')\n sessionStorage.setItem(\n 'runningModelType',\n '/running_models/LLM'\n )\n setActive(link)\n console.log(active)\n } else if (link === 'register_model') {\n sessionStorage.setItem(\n 'registerModelType',\n '/register_model/llm'\n )\n navigate('/register_model/llm')\n setActive(link)\n console.log(active)\n } else {\n navigate(`/${link}`)\n setActive(link)\n console.log(active)\n }\n }}\n >\n <ListItemIcon\n sx={{\n ml: '2rem',\n }}\n >\n {icon}\n </ListItemIcon>\n <ListItemText primary={text} />\n <ChevronRightOutlined sx={{ ml: 'auto' }} />\n </ListItemButton>\n </ListItem>\n )\n })}\n </List>\n </Box>\n </Box>\n </Drawer>\n )\n}\n\nexport default MenuSide\n"],"mappings":"waAAA,OACEA,cAAc,CACdC,oBAAoB,CACpBC,WAAW,CACXC,MAAM,CACNC,oBAAoB,CACpBC,gBAAgB,KACX,qBAAqB,CAC5B,OACEC,GAAG,CACHC,MAAM,CACNC,IAAI,CACJC,QAAQ,CACRC,cAAc,CACdC,YAAY,CACZC,YAAY,CACZC,UAAU,CACVC,QAAQ,KACH,eAAe,CACtB,OAASC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC3C,OAASC,WAAW,CAAEC,WAAW,KAAQ,kBAAkB,CAE3D,MAAO,CAAAC,IAAI,KAAM,oBAAoB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAErC,GAAM,CAAAC,QAAQ,CAAG,CACf,CACEC,IAAI,CAAE,cAAc,CACpBN,IAAI,cAAEE,IAAA,CAACjB,oBAAoB,GAAE,CAC/B,CAAC,CACD,CACEqB,IAAI,CAAE,gBAAgB,CACtBN,IAAI,cAAEE,IAAA,CAAChB,gBAAgB,GAAE,CAC3B,CAAC,CACD,CACEoB,IAAI,CAAE,gBAAgB,CACtBN,IAAI,cAAEE,IAAA,CAACrB,cAAc,GAAE,CACzB,C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C+E,OAAO,CAAElE,IAAK,CAAE,CAAC,cAC/BJ,IAAA,CAACpB,oBAAoB,EAACsD,EAAE,CAAE,CAAEmC,EAAE,CAAE,MAAO,CAAE,CAAE,CAAC,EAC9B,CAAC,EAjDJjE,IAkDL,CAAC,CAEf,CAAC,CAAC,CACE,CAAC,EACJ,CAAC,CACH,CAAC,EACA,CAAC,CAEb,CAAC,CAED,cAAe,CAAAC,QAAQ","ignoreList":[]},"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 _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Chip,FormControl,InputLabel,MenuItem,Select}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';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 modelAbilityArr=['generate','chat','vision'];var LaunchLLM=function LaunchLLM(_ref){var gpuAvailable=_ref.gpuAvailable;var endPoint=useContext(ApiContext).endPoint;var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];// States used for filtering\nvar _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(''),_useState6=_slicedToArray(_useState5,2),modelAbility=_useState6[0],setModelAbility=_useState6[1];var _useState7=useState(''),_useState8=_slicedToArray(_useState7,2),status=_useState8[0],setStatus=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),statusArr=_useState10[0],setStatusArr=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),completeDeleteArr=_useState12[0],setCompleteDeleteArr=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),collectionArr=_useState14[0],setCollectionArr=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),filterArr=_useState16[0],setFilterArr=_useState16[1];var filter=function filter(registration){if(searchTerm!==''){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';var modelDescription=registration.model_description?registration.model_description.toLowerCase():'';if(!modelName.includes(searchTerm.toLowerCase())&&!modelDescription.includes(searchTerm.toLowerCase())){return false;}}if(modelAbility&&registration.model_ability.indexOf(modelAbility)<0)return false;if(completeDeleteArr.includes(registration.model_name)){registration.model_specs.forEach(function(item){item.cache_status=Array.isArray(item)?[false]:false;});}if(statusArr.length===1){if(statusArr[0]==='cached'){var judge=registration.model_specs.some(function(spec){return filterCache(spec);});return judge&&!completeDeleteArr.includes(registration.model_name);}else{return collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name);}}else if(statusArr.length>1){var _judge=registration.model_specs.some(function(spec){return filterCache(spec);});return _judge&&!completeDeleteArr.includes(registration.model_name)&&(collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name));}return true;};var filterCache=function filterCache(spec){if(spec.model_format==='pytorch'){return spec.cache_status&&spec.cache_status===true;}else{return spec.cache_status&&spec.cache_status.some(function(cs){return cs;});}};var handleCompleteDelete=function handleCompleteDelete(model_name){setCompleteDeleteArr([].concat(_toConsumableArray(completeDeleteArr),[model_name]));};var update=function update(){if(isCallingApi||isUpdatingModel||cookie.token!=='no_auth'&&!sessionStorage.getItem('token'))return;try{setIsCallingApi(true);fetcher(\"\".concat(endPoint,\"/v1/model_registrations/LLM?detailed=true\"),{method:'GET'}).then(function(response){if(!response.ok){response.json().then(function(errData){return setErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errData.detail||'Unknown error'));});}else{response.json().then(function(data){var builtinRegistrations=data.filter(function(v){return v.is_builtin;});setRegistrationData(builtinRegistrations);var collectionData=JSON.parse(localStorage.getItem('collectionArr'));setCollectionArr(collectionData);});}});}catch(error){console.error('Error:',error);}finally{setIsCallingApi(false);}};useEffect(function(){update();},[cookie.token]);var getCollectionArr=function getCollectionArr(data){setCollectionArr(data);};var handleChangeFilter=function handleChangeFilter(type,value){if(type==='modelAbility'){setModelAbility(value);setFilterArr([].concat(_toConsumableArray(filterArr.filter(function(item){return!modelAbilityArr.includes(item);})),[value]));}else{setStatus(value);var arr=[].concat(_toConsumableArray(filterArr.filter(function(item){return item!==value;})),[value]);setFilterArr(arr);setStatusArr(arr.filter(function(item){return!modelAbilityArr.includes(item);}));}};var handleDeleteChip=function handleDeleteChip(item){setFilterArr(filterArr.filter(function(subItem){return subItem!==item;}));if(item===modelAbility){setModelAbility('');}else{setStatusArr(statusArr.filter(function(subItem){return subItem!==item;}));if(item===status)setStatus('');}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'grid',gridTemplateColumns:'150px 150px 1fr',columnGap:'20px',margin:'30px 2rem'},children:[/*#__PURE__*/_jsxs(FormControl,{sx:{marginTop:2,minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"ability-select-label\",children:\"Model Ability\"}),/*#__PURE__*/_jsxs(Select,{id:\"ability\",labelId:\"ability-select-label\",label:\"Model Ability\",onChange:function onChange(e){return handleChangeFilter('modelAbility',e.target.value);},value:modelAbility,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"generate\",children:\"generate\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"chat\",children:\"chat\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"vision\",children:\"vl-chat\"})]})]}),/*#__PURE__*/_jsxs(FormControl,{sx:{marginTop:2,minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"select-status\",children:\"Status\"}),/*#__PURE__*/_jsxs(Select,{id:\"status\",labelId:\"select-status\",label:\"Status\",onChange:function onChange(e){return handleChangeFilter('status',e.target.value);},value:status,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"cached\",children:\"cached\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"favorite\",children:\"favorite\"})]})]}),/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for model name and description\",value:searchTerm,onChange:function onChange(e){return setSearchTerm(e.target.value);},size:\"small\",hotkey:\"/\"})})]}),/*#__PURE__*/_jsx(\"div\",{style:{margin:'0 0 30px 30px'},children:filterArr.map(function(item,index){return/*#__PURE__*/_jsx(Chip,{label:item,variant:\"outlined\",size:\"small\",color:\"primary\",style:{marginRight:10},onDelete:function onDelete(){return handleDeleteChip(item);}},index);})}),/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',gridGap:'2rem 0rem'},children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,modelType:'LLM',onHandleCompleteDelete:handleCompleteDelete,onGetCollectionArr:getCollectionArr},filteredRegistration.model_name);})})]});};export default LaunchLLM;","map":{"version":3,"names":["Box","Chip","FormControl","InputLabel","MenuItem","Select","React","useContext","useEffect","useState","useCookies","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","modelAbilityArr","LaunchLLM","_ref","gpuAvailable","endPoint","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useContext3","setErrorMsg","_useCookies","_useCookies2","_slicedToArray","cookie","_useState","_useState2","registrationData","setRegistrationData","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","_useState6","modelAbility","setModelAbility","_useState7","_useState8","status","setStatus","_useState9","_useState10","statusArr","setStatusArr","_useState11","_useState12","completeDeleteArr","setCompleteDeleteArr","_useState13","_useState14","collectionArr","setCollectionArr","_useState15","_useState16","filterArr","setFilterArr","filter","registration","modelName","model_name","toLowerCase","modelDescription","model_description","includes","model_ability","indexOf","model_specs","forEach","item","cache_status","Array","isArray","length","judge","some","spec","filterCache","model_format","cs","handleCompleteDelete","concat","_toConsumableArray","update","token","sessionStorage","getItem","method","then","response","ok","json","errData","detail","data","builtinRegistrations","v","is_builtin","collectionData","JSON","parse","localStorage","error","console","getCollectionArr","handleChangeFilter","type","value","arr","handleDeleteChip","subItem","m","children","style","display","gridTemplateColumns","columnGap","margin","sx","marginTop","minWidth","size","id","labelId","label","onChange","e","target","width","variant","hotkey","map","index","color","marginRight","onDelete","paddingLeft","gridGap","filteredRegistration","url","modelData","modelType","onHandleCompleteDelete","onGetCollectionArr"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchLLM.js"],"sourcesContent":["import {\n Box,\n Chip,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n} from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\n\nconst modelAbilityArr = ['generate', 'chat', 'vision']\n\nconst LaunchLLM = ({ gpuAvailable }) => {\n let endPoint = useContext(ApiContext).endPoint\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n\n const [registrationData, setRegistrationData] = useState([])\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState('')\n const [modelAbility, setModelAbility] = useState('')\n const [status, setStatus] = useState('')\n const [statusArr, setStatusArr] = useState([])\n const [completeDeleteArr, setCompleteDeleteArr] = useState([])\n const [collectionArr, setCollectionArr] = useState([])\n const [filterArr, setFilterArr] = useState([])\n\n const filter = (registration) => {\n if (searchTerm !== '') {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n const modelDescription = registration.model_description\n ? registration.model_description.toLowerCase()\n : ''\n\n if (\n !modelName.includes(searchTerm.toLowerCase()) &&\n !modelDescription.includes(searchTerm.toLowerCase())\n ) {\n return false\n }\n }\n\n if (modelAbility && registration.model_ability.indexOf(modelAbility) < 0)\n return false\n\n if (completeDeleteArr.includes(registration.model_name)) {\n registration.model_specs.forEach((item) => {\n item.cache_status = Array.isArray(item) ? [false] : false\n })\n }\n\n if (statusArr.length === 1) {\n if (statusArr[0] === 'cached') {\n const judge = registration.model_specs.some((spec) => filterCache(spec))\n return judge && !completeDeleteArr.includes(registration.model_name)\n } else {\n return collectionArr?.includes(registration.model_name)\n }\n } else if (statusArr.length > 1) {\n const judge = registration.model_specs.some((spec) => filterCache(spec))\n return (\n judge &&\n !completeDeleteArr.includes(registration.model_name) &&\n collectionArr?.includes(registration.model_name)\n )\n }\n\n return true\n }\n\n const filterCache = (spec) => {\n if (spec.model_format === 'pytorch') {\n return spec.cache_status && spec.cache_status === true\n } else {\n return spec.cache_status && spec.cache_status.some((cs) => cs)\n }\n }\n\n const handleCompleteDelete = (model_name) => {\n setCompleteDeleteArr([...completeDeleteArr, model_name])\n }\n\n const update = () => {\n if (\n isCallingApi ||\n isUpdatingModel ||\n (cookie.token !== 'no_auth' && !sessionStorage.getItem('token'))\n )\n return\n\n try {\n setIsCallingApi(true)\n\n fetcher(`${endPoint}/v1/model_registrations/LLM?detailed=true`, {\n method: 'GET',\n }).then((response) => {\n if (!response.ok) {\n response\n .json()\n .then((errData) =>\n setErrorMsg(\n `Server error: ${response.status} - ${\n errData.detail || 'Unknown error'\n }`\n )\n )\n } else {\n response.json().then((data) => {\n const builtinRegistrations = data.filter((v) => v.is_builtin)\n setRegistrationData(builtinRegistrations)\n const collectionData = JSON.parse(\n localStorage.getItem('collectionArr')\n )\n setCollectionArr(collectionData)\n })\n }\n })\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [cookie.token])\n\n const getCollectionArr = (data) => {\n setCollectionArr(data)\n }\n\n const handleChangeFilter = (type, value) => {\n if (type === 'modelAbility') {\n setModelAbility(value)\n setFilterArr([\n ...filterArr.filter((item) => {\n return !modelAbilityArr.includes(item)\n }),\n value,\n ])\n } else {\n setStatus(value)\n const arr = [\n ...filterArr.filter((item) => {\n return item !== value\n }),\n value,\n ]\n setFilterArr(arr)\n setStatusArr(\n arr.filter((item) => {\n return !modelAbilityArr.includes(item)\n })\n )\n }\n }\n\n const handleDeleteChip = (item) => {\n setFilterArr(\n filterArr.filter((subItem) => {\n return subItem !== item\n })\n )\n if (item === modelAbility) {\n setModelAbility('')\n } else {\n setStatusArr(\n statusArr.filter((subItem) => {\n return subItem !== item\n })\n )\n if (item === status) setStatus('')\n }\n }\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '150px 150px 1fr',\n columnGap: '20px',\n margin: '30px 2rem',\n }}\n >\n <FormControl sx={{ marginTop: 2, minWidth: 120 }} size=\"small\">\n <InputLabel id=\"ability-select-label\">Model Ability</InputLabel>\n <Select\n id=\"ability\"\n labelId=\"ability-select-label\"\n label=\"Model Ability\"\n onChange={(e) => handleChangeFilter('modelAbility', e.target.value)}\n value={modelAbility}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"generate\">generate</MenuItem>\n <MenuItem value=\"chat\">chat</MenuItem>\n <MenuItem value=\"vision\">vl-chat</MenuItem>\n </Select>\n </FormControl>\n <FormControl sx={{ marginTop: 2, minWidth: 120 }} size=\"small\">\n <InputLabel id=\"select-status\">Status</InputLabel>\n <Select\n id=\"status\"\n labelId=\"select-status\"\n label=\"Status\"\n onChange={(e) => handleChangeFilter('status', e.target.value)}\n value={status}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"cached\">cached</MenuItem>\n <MenuItem value=\"favorite\">favorite</MenuItem>\n </Select>\n </FormControl>\n\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for model name and description\"\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={{ margin: '0 0 30px 30px' }}>\n {filterArr.map((item, index) => (\n <Chip\n key={index}\n label={item}\n variant=\"outlined\"\n size=\"small\"\n color=\"primary\"\n style={{ marginRight: 10 }}\n onDelete={() => handleDeleteChip(item)}\n />\n ))}\n </div>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n gridGap: '2rem 0rem',\n }}\n >\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n modelType={'LLM'}\n onHandleCompleteDelete={handleCompleteDelete}\n onGetCollectionArr={getCollectionArr}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchLLM\n"],"mappings":"kSAAA,OACEA,GAAG,CACHC,IAAI,CACJC,WAAW,CACXC,UAAU,CACVC,QAAQ,CACRC,MAAM,KACD,eAAe,CACtB,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KA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CAAC,OAAO,CACZY,KAAK,CAAC,SAAS,CACfpB,KAAK,CAAE,CAAEqB,WAAW,CAAE,EAAG,CAAE,CAC3BC,QAAQ,CAAE,SAAAA,SAAA,QAAM,CAAA1B,gBAAgB,CAACxC,IAAI,CAAC,EAAC,EANlC+D,KAON,CAAC,EACH,CAAC,CACC,CAAC,cACN9H,IAAA,QACE2G,KAAK,CAAE,CACLC,OAAO,CAAE,MAAM,CACfC,mBAAmB,CAAE,uCAAuC,CAC5DqB,WAAW,CAAE,MAAM,CACnBC,OAAO,CAAE,WACX,CAAE,CAAAzB,QAAA,CAEDrF,gBAAgB,CACd8B,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9CyE,GAAG,CAAC,SAACO,oBAAoB,qBACxBpI,IAAA,CAACF,SAAS,EAERuI,GAAG,CAAE9H,QAAS,CACd+H,SAAS,CAAEF,oBAAqB,CAChC9H,YAAY,CAAEA,YAAa,CAC3BiI,SAAS,CAAE,KAAM,CACjBC,sBAAsB,CAAE9D,oBAAqB,CAC7C+D,kBAAkB,CAAEvC,gBAAiB,EANhCkC,oBAAoB,CAAC9E,UAO3B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAlD,SAAS","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import{Navigate,useRoutes}from'react-router-dom';import Layout from'../scenes/_layout';import ClusterInfo from'../scenes/cluster_info';import LaunchModel from'../scenes/launch_model';import Login from'../scenes/login/login';import RegisterModel from'../scenes/register_model';import RunningModels from'../scenes/running_models';import{jsx as _jsx}from\"react/jsx-runtime\";var routes=[{path:'/',element:/*#__PURE__*/_jsx(Layout,{}),children:[{path:'/',element:/*#__PURE__*/_jsx(Navigate,{to:\"launch_model/llm\",replace:true})},{path:'launch_model/:Modeltype/:subType?',element:/*#__PURE__*/_jsx(LaunchModel,{})},{path:'running_models/:runningModelType',element:/*#__PURE__*/_jsx(RunningModels,{})},{path:'register_model/:registerModelType/:model_name?',element:/*#__PURE__*/_jsx(RegisterModel,{})},{path:'cluster_info',element:/*#__PURE__*/_jsx(ClusterInfo,{})}]},{path:'/login',element:/*#__PURE__*/_jsx(Login,{})},{path:'*',element:/*#__PURE__*/_jsx(Navigate,{to:\"launch_model/llm\",replace:true})}];var WraperRoutes=function WraperRoutes(){var element=useRoutes(routes);return element;};export default WraperRoutes;","map":{"version":3,"names":["Navigate","useRoutes","Layout","ClusterInfo","LaunchModel","Login","RegisterModel","RunningModels","jsx","_jsx","routes","path","element","children","to","replace","WraperRoutes"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/router/index.js"],"sourcesContent":["import { Navigate, useRoutes } from 'react-router-dom'\n\nimport Layout from '../scenes/_layout'\nimport ClusterInfo from '../scenes/cluster_info'\nimport LaunchModel from '../scenes/launch_model'\nimport Login from '../scenes/login/login'\nimport RegisterModel from '../scenes/register_model'\nimport RunningModels from '../scenes/running_models'\n\nconst routes = [\n {\n path: '/',\n element: <Layout />,\n children: [\n {\n path: '/',\n element: <Navigate to=\"launch_model/llm\" replace />,\n },\n {\n path: 'launch_model/:Modeltype/:subType?',\n element: <LaunchModel />,\n },\n {\n path: 'running_models/:runningModelType',\n element: <RunningModels />,\n },\n {\n path: 'register_model/:registerModelType/:model_name?',\n element: <RegisterModel />,\n },\n {\n path: 'cluster_info',\n element: <ClusterInfo />,\n },\n ],\n },\n {\n path: '/login',\n element: <Login />,\n },\n {\n path: '*',\n element: <Navigate to=\"launch_model/llm\" replace />,\n },\n]\nconst WraperRoutes = () => {\n let element = useRoutes(routes)\n return element\n}\n\nexport default WraperRoutes\n"],"mappings":"AAAA,OAASA,QAAQ,CAAEC,SAAS,KAAQ,kBAAkB,CAEtD,MAAO,CAAAC,MAAM,KAAM,mBAAmB,CACtC,MAAO,CAAAC,WAAW,KAAM,wBAAwB,CAChD,MAAO,CAAAC,WAAW,KA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