xinference 0.10.1__py3-none-any.whl → 0.10.2.post1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xinference might be problematic. Click here for more details.
- xinference/_version.py +3 -3
- xinference/api/restful_api.py +9 -9
- xinference/client/restful/restful_client.py +29 -16
- xinference/core/supervisor.py +32 -9
- xinference/core/worker.py +13 -8
- xinference/deploy/cmdline.py +22 -9
- xinference/model/audio/__init__.py +40 -1
- xinference/model/audio/core.py +25 -45
- xinference/model/audio/custom.py +148 -0
- xinference/model/core.py +6 -9
- xinference/model/embedding/model_spec.json +24 -0
- xinference/model/embedding/model_spec_modelscope.json +24 -0
- xinference/model/image/core.py +12 -4
- xinference/model/image/stable_diffusion/core.py +8 -7
- xinference/model/llm/core.py +9 -14
- xinference/model/llm/llm_family.json +263 -0
- xinference/model/llm/llm_family.py +26 -4
- xinference/model/llm/llm_family_modelscope.json +160 -0
- xinference/model/llm/pytorch/baichuan.py +4 -3
- xinference/model/llm/pytorch/chatglm.py +3 -2
- xinference/model/llm/pytorch/core.py +15 -13
- xinference/model/llm/pytorch/falcon.py +6 -5
- xinference/model/llm/pytorch/internlm2.py +3 -2
- xinference/model/llm/pytorch/llama_2.py +6 -5
- xinference/model/llm/pytorch/vicuna.py +4 -3
- xinference/model/llm/vllm/core.py +3 -0
- xinference/model/rerank/core.py +23 -12
- xinference/model/rerank/model_spec.json +24 -0
- xinference/model/rerank/model_spec_modelscope.json +25 -1
- xinference/model/utils.py +12 -1
- xinference/types.py +55 -0
- xinference/utils.py +1 -0
- xinference/web/ui/build/asset-manifest.json +3 -3
- xinference/web/ui/build/index.html +1 -1
- xinference/web/ui/build/static/js/main.26fdbfbe.js +3 -0
- xinference/web/ui/build/static/js/main.26fdbfbe.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/1870cd6f7054d04e049e363c0a85526584fe25519378609d2838e28d7492bbf1.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/1e86938a0cdf706d21e99b21f5d868fa247c0c88b26807047e26dcdc4d9a9db3.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/f4d5d1a41892a754c1ee0237450d804b20612d1b657945b59e564161ea47aa7a.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/f9290c0738db50065492ceedc6a4af25083fe18399b7c44d942273349ad9e643.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/fad4cd70de36ef6e6d5f8fd74a10ded58d964a8a91ef7681693fbb8376552da7.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/feabb04b4aa507102da0a64398a40818e878fd1df9b75dda8461b3e1e7ff3f11.json +1 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.post1.dist-info}/METADATA +4 -1
- {xinference-0.10.1.dist-info → xinference-0.10.2.post1.dist-info}/RECORD +49 -46
- xinference/web/ui/build/static/js/main.76ef2b17.js +0 -3
- xinference/web/ui/build/static/js/main.76ef2b17.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/35d0e4a317e5582cbb79d901302e9d706520ac53f8a734c2fd8bfde6eb5a4f02.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/d076fd56cf3b15ed2433e3744b98c6b4e4410a19903d1db4de5bba0e1a1b3347.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/daad8131d91134f6d7aef895a0c9c32e1cb928277cb5aa66c01028126d215be0.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/f16aec63602a77bd561d0e67fa00b76469ac54b8033754bba114ec5eb3257964.json +0 -1
- /xinference/web/ui/build/static/js/{main.76ef2b17.js.LICENSE.txt → main.26fdbfbe.js.LICENSE.txt} +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.post1.dist-info}/LICENSE +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.post1.dist-info}/WHEEL +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.post1.dist-info}/entry_points.txt +0 -0
- {xinference-0.10.1.dist-info → xinference-0.10.2.post1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,FormControl}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import HotkeyFocusTextField from'../../components/hotkeyFocusTextField';import ModelCard from'./modelCard';import style from'./styles/launchModelStyle';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchModelComponent=function LaunchModelComponent(_ref){var modelType=_ref.modelType;var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var handleChange=function handleChange(e){setSearchTerm(e.target.value);};var filter=function filter(registration){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';return modelName.includes(searchTerm.toLowerCase());};var update=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,registrations,builtinModels;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context.next=2;break;}return _context.abrupt(\"return\");case 2:_context.prev=2;setIsCallingApi(true);_context.next=6;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/\").concat(modelType,\"?detailed=true\"),{method:'GET'});case 6:response=_context.sent;_context.next=9;return response.json();case 9:registrations=_context.sent;builtinModels=registrations.filter(function(v){return v.is_builtin;});setRegistrationData(builtinModels);_context.next=17;break;case 14:_context.prev=14;_context.t0=_context[\"catch\"](2);console.error('Error:',_context.t0);case 17:_context.prev=17;setIsCallingApi(false);return _context.finish(17);case 20:case\"end\":return _context.stop();}},_callee,null,[[2,14,17,20]]);}));return function update(){return _ref2.apply(this,arguments);};}();useEffect(function(){update();},[]);return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for \".concat(modelType,\" model name\"),value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,modelType:modelType},filteredRegistration.model_name);})})]});};export default LaunchModelComponent;","map":{"version":3,"names":["Box","FormControl","React","useContext","useEffect","useState","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","style","jsx","_jsx","jsxs","_jsxs","LaunchModelComponent","_ref","modelType","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useState3","_useState4","searchTerm","setSearchTerm","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","handleChange","e","target","value","filter","registration","modelName","model_name","toLowerCase","includes","update","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","registrations","builtinModels","wrap","_callee$","_context","prev","next","abrupt","concat","method","sent","json","v","is_builtin","t0","console","error","finish","stop","apply","arguments","m","children","display","gridTemplateColumns","margin","variant","id","type","label","onChange","size","hotkey","map","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/LaunchModelComponent.js"],"sourcesContent":["import { Box, FormControl } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\nimport style from './styles/launchModelStyle'\n\nconst LaunchModelComponent = ({ modelType }) => {\n let endPoint = useContext(ApiContext).endPoint\n const [registrationData, setRegistrationData] = useState([])\n const [searchTerm, setSearchTerm] = useState('')\n\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n const handleChange = (e) => {\n setSearchTerm(e.target.value)\n }\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n return modelName.includes(searchTerm.toLowerCase())\n }\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return\n\n try {\n setIsCallingApi(true)\n\n const response = await fetcher(\n `${endPoint}/v1/model_registrations/${modelType}?detailed=true`,\n {\n method: 'GET',\n }\n )\n\n const registrations = await response.json()\n\n const builtinModels = registrations.filter((v) => {\n return v.is_builtin\n })\n setRegistrationData(builtinModels)\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [])\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label={`Search for ${modelType} model name`}\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n modelType={modelType}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchModelComponent\n"],"mappings":"ubAAA,OAASA,GAAG,CAAEC,WAAW,KAAQ,eAAe,CAChD,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,CACnC,MAAO,CAAAC,KAAK,KAAM,2BAA2B,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAE7C,GAAM,CAAAC,oBAAoB,CAAG,QAAvB,CAAAA,oBAAoBA,CAAAC,IAAA,CAAsB,IAAhB,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACvC,GAAI,CAAAC,QAAQ,CAAGf,UAAU,CAACG,UAAU,CAAC,CAACY,QAAQ,CAC9C,IAAAC,SAAA,CAAgDd,QAAQ,CAAC,EAAE,CAAC,CAAAe,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAArDG,gBAAgB,CAAAF,UAAA,IAAEG,mBAAmB,CAAAH,UAAA,IAC5C,IAAAI,UAAA,CAAoCnB,QAAQ,CAAC,EAAE,CAAC,CAAAoB,UAAA,CAAAJ,cAAA,CAAAG,UAAA,IAAzCE,UAAU,CAAAD,UAAA,IAAEE,aAAa,CAAAF,UAAA,IAEhC,IAAAG,WAAA,CAA0CzB,UAAU,CAACG,UAAU,CAAC,CAAxDuB,YAAY,CAAAD,WAAA,CAAZC,YAAY,CAAEC,eAAe,CAAAF,WAAA,CAAfE,eAAe,CACrC,I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A,QAAKF,KAAK,CAAEA,KAAM,CAAA8D,QAAA,CACflD,gBAAgB,CACde,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9C6C,GAAG,CAAC,SAACC,oBAAoB,qBACxBxE,IAAA,CAACH,SAAS,EAER4E,GAAG,CAAEnE,QAAS,CACdoE,SAAS,CAAEF,oBAAqB,CAChCnE,SAAS,CAAEA,SAAU,EAHhBmE,oBAAoB,CAAC5C,UAI3B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAzB,oBAAoB"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,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 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('all'),_useState6=_slicedToArray(_useState5,2),modelAbility=_useState6[0],setModelAbility=_useState6[1];var handleChange=function handleChange(event){setSearchTerm(event.target.value);};var handleAbilityChange=function handleAbilityChange(event){setModelAbility(event.target.value);};var filter=function filter(registration){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&&modelAbility!=='all'){if(registration.model_ability.indexOf(modelAbility)<0){return false;}}return true;};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);});}});}catch(error){console.error('Error:',error);}finally{setIsCallingApi(false);}};useEffect(function(){update();},[cookie.token]);var style={display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',gridGap:'2rem 0rem'};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,{variant:\"outlined\",margin:\"normal\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"ability-select-label\",children:\"Model Ability\"}),/*#__PURE__*/_jsxs(Select,{id:\"ability\",labelId:\"ability-select-label\",label:\"Model Ability\",onChange:handleAbilityChange,value:modelAbility,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"all\",children:\"all\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"generate\",children:\"generate\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"chat\",children:\"chat\"}),/*#__PURE__*/_jsx(MenuItem,{value:\"vision\",children:\"vl-chat\"})]})]}),/*#__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:handleChange,size:\"small\",hotkey:\"/\"})})]}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,modelType:'LLM'},filteredRegistration.model_name);})})]});};export default LaunchLLM;","map":{"version":3,"names":["Box","FormControl","InputLabel","MenuItem","Select","React","useContext","useEffect","useState","useCookies","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","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","handleChange","event","target","value","handleAbilityChange","filter","registration","modelName","model_name","toLowerCase","modelDescription","model_description","includes","model_ability","indexOf","update","token","sessionStorage","getItem","concat","method","then","response","ok","json","errData","status","detail","data","builtinRegistrations","v","is_builtin","error","console","style","display","gridTemplateColumns","paddingLeft","gridGap","m","children","columnGap","margin","variant","id","labelId","label","onChange","size","sx","width","type","hotkey","map","filteredRegistration","url","modelData","modelType"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchLLM.js"],"sourcesContent":["import { Box, FormControl, InputLabel, MenuItem, Select } 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 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('all')\n\n const handleChange = (event) => {\n setSearchTerm(event.target.value)\n }\n\n const handleAbilityChange = (event) => {\n setModelAbility(event.target.value)\n }\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n 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 if (modelAbility && modelAbility !== 'all') {\n if (registration.model_ability.indexOf(modelAbility) < 0) {\n return false\n }\n }\n return true\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 })\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 style = {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n gridGap: '2rem 0rem',\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 variant=\"outlined\" margin=\"normal\">\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={handleAbilityChange}\n value={modelAbility}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"all\">all</MenuItem>\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 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={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n modelType={'LLM'}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchLLM\n"],"mappings":"6IAAA,OAASA,GAAG,CAAEC,WAAW,CAAEC,UAAU,CAAEC,QAAQ,CAAEC,MAAM,KAAQ,eAAe,CAC9E,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CAEzC,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,oBAAoB,KAAM,uCA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,CAAC,EACX,CAAC,cACNlF,IAAA,QAAKgE,KAAK,CAAEA,KAAM,CAAAM,QAAA,CACflD,gBAAgB,CACde,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9C+C,GAAG,CAAC,SAACC,oBAAoB,qBACxBpF,IAAA,CAACF,SAAS,EAERuF,GAAG,CAAE/E,QAAS,CACdgF,SAAS,CAAEF,oBAAqB,CAChC/E,YAAY,CAAEA,YAAa,CAC3BkF,SAAS,CAAE,KAAM,EAJZH,oBAAoB,CAAC9C,UAK3B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAnC,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,FormControl,Tab}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import HotkeyFocusTextField from'../../components/hotkeyFocusTextField';import ModelCard from'./modelCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchCustom=function LaunchCustom(_ref){var gpuAvailable=_ref.gpuAvailable;var endPoint=useContext(ApiContext).endPoint;var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;// States used for filtering\nvar _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(sessionStorage.getItem('subType')),_useState6=_slicedToArray(_useState5,2),value=_useState6[0],setValue=_useState6[1];var navigate=useNavigate();var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);update();navigate(newValue);sessionStorage.setItem('subType',newValue);};var handleChange=function handleChange(event){setSearchTerm(event.target.value);};var filter=function filter(registration){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';return modelName.includes(searchTerm.toLowerCase());};var update=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var rerankResponse,rerankRegistrations,customRerankRegistrations,embeddingResponse,embeddingRegistrations,customEmbeddingRegistrations,llmResponse,llmRegistrations,customLLMRegistrations,newEmbeddingData,newLLMData,newRerankData;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context4.next=2;break;}return _context4.abrupt(\"return\");case 2:_context4.prev=2;setIsCallingApi(true);_context4.next=6;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/rerank\"),{method:'GET'});case 6:rerankResponse=_context4.sent;_context4.next=9;return rerankResponse.json();case 9:rerankRegistrations=_context4.sent;customRerankRegistrations=rerankRegistrations.filter(function(data){return!data.is_builtin;});_context4.next=13;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/embedding\"),{method:'GET'});case 13:embeddingResponse=_context4.sent;_context4.next=16;return embeddingResponse.json();case 16:embeddingRegistrations=_context4.sent;customEmbeddingRegistrations=embeddingRegistrations.filter(function(data){return!data.is_builtin;});_context4.next=20;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/LLM\"),{method:'GET'});case 20:llmResponse=_context4.sent;_context4.next=23;return llmResponse.json();case 23:llmRegistrations=_context4.sent;customLLMRegistrations=llmRegistrations.filter(function(data){return!data.is_builtin;});_context4.next=27;return Promise.all(customEmbeddingRegistrations.map(/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/embedding/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context.sent;_context.t0=_objectSpread;_context.t1=_objectSpread;_context.t2={};_context.next=8;return desc.json();case 8:_context.t3=_context.sent;_context.t4=(0,_context.t1)(_context.t2,_context.t3);_context.t5={};_context.t6={is_builtin:registration.is_builtin};return _context.abrupt(\"return\",(0,_context.t0)(_context.t4,_context.t5,_context.t6));case 13:case\"end\":return _context.stop();}},_callee);}));return function(_x){return _ref3.apply(this,arguments);};}()));case 27:newEmbeddingData=_context4.sent;_context4.next=30;return Promise.all(customLLMRegistrations.map(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(registration){var desc;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/LLM/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context2.sent;_context2.t0=_objectSpread;_context2.t1=_objectSpread;_context2.t2={};_context2.next=8;return desc.json();case 8:_context2.t3=_context2.sent;_context2.t4=(0,_context2.t1)(_context2.t2,_context2.t3);_context2.t5={};_context2.t6={is_builtin:registration.is_builtin};return _context2.abrupt(\"return\",(0,_context2.t0)(_context2.t4,_context2.t5,_context2.t6));case 13:case\"end\":return _context2.stop();}},_callee2);}));return function(_x2){return _ref4.apply(this,arguments);};}()));case 30:newLLMData=_context4.sent;_context4.next=33;return Promise.all(customRerankRegistrations.map(/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(registration){var desc;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return fetcher(\"\".concat(endPoint,\"/v1/model_registrations/rerank/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context3.sent;_context3.t0=_objectSpread;_context3.t1=_objectSpread;_context3.t2={};_context3.next=8;return desc.json();case 8:_context3.t3=_context3.sent;_context3.t4=(0,_context3.t1)(_context3.t2,_context3.t3);_context3.t5={};_context3.t6={is_builtin:registration.is_builtin};return _context3.abrupt(\"return\",(0,_context3.t0)(_context3.t4,_context3.t5,_context3.t6));case 13:case\"end\":return _context3.stop();}},_callee3);}));return function(_x3){return _ref5.apply(this,arguments);};}()));case 33:newRerankData=_context4.sent;setRegistrationData(newLLMData.concat(newEmbeddingData).concat(newRerankData));_context4.next=40;break;case 37:_context4.prev=37;_context4.t0=_context4[\"catch\"](2);console.error('Error:',_context4.t0);case 40:_context4.prev=40;setIsCallingApi(false);return _context4.finish(40);case 43:case\"end\":return _context4.stop();}},_callee4,null,[[2,37,40,43]]);}));return function update(){return _ref2.apply(this,arguments);};}();useEffect(function(){update();},[]);var style={display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',paddingBottom:'2rem',gridGap:'2rem 0rem'};return/*#__PURE__*/_jsx(Box,{m:\"20px\",children:/*#__PURE__*/_jsxs(TabContext,{value:value,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:value,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Models\",value:\"/launch_model/custom/llm\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"/launch_model/custom/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Models\",value:\"/launch_model/custom/rerank\"})]})}),/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/llm\",sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for custom model name\",value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(!(filteredRegistration.max_tokens&&filteredRegistration.dimensions)&&!(filteredRegistration.model_type&&filteredRegistration.model_type==='rerank')){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,is_custom:true,modelType:\"LLM\"},filteredRegistration.model_name);}})})]}),/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/embedding\",sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for custom model name\",value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(filteredRegistration.max_tokens&&filteredRegistration.dimensions){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,is_custom:true,modelType:\"embedding\"},filteredRegistration.model_name);}})})]}),/*#__PURE__*/_jsxs(TabPanel,{value:\"/launch_model/custom/rerank\",sx:{padding:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'1fr',margin:'30px 2rem'},children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:\"Search for custom model name\",value:searchTerm,onChange:handleChange,size:\"small\",hotkey:\"/\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(filteredRegistration.model_type&&filteredRegistration.model_type==='rerank'){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,is_custom:true,modelType:\"rerank\"},filteredRegistration.model_name);}})})]})]})});};export default LaunchCustom;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","FormControl","Tab","React","useContext","useEffect","useState","useNavigate","ApiContext","fetcher","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","LaunchCustom","_ref","gpuAvailable","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","sessionStorage","getItem","_useState6","value","setValue","navigate","handleTabChange","event","newValue","update","setItem","handleChange","target","filter","registration","modelName","model_name","toLowerCase","includes","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee4","rerankResponse","rerankRegistrations","customRerankRegistrations","embeddingResponse","embeddingRegistrations","customEmbeddingRegistrations","llmResponse","llmRegistrations","customLLMRegistrations","newEmbeddingData","newLLMData","newRerankData","wrap","_callee4$","_context4","prev","next","abrupt","concat","method","sent","json","data","is_builtin","Promise","all","map","_ref3","_callee","desc","_callee$","_context","t0","_objectSpread","t1","t2","t3","t4","t5","t6","stop","_x","apply","arguments","_ref4","_callee2","_callee2$","_context2","_x2","_ref5","_callee3","_callee3$","_context3","_x3","console","error","finish","style","display","gridTemplateColumns","paddingLeft","paddingBottom","gridGap","m","children","sx","borderBottom","borderColor","onChange","label","padding","margin","variant","id","type","size","hotkey","filteredRegistration","max_tokens","dimensions","model_type","url","modelData","is_custom","modelType"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchCustom.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, FormControl, Tab } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\n\nconst LaunchCustom = ({ gpuAvailable }) => {\n let endPoint = useContext(ApiContext).endPoint\n const [registrationData, setRegistrationData] = useState([])\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n // States used for filtering\n const [searchTerm, setSearchTerm] = useState('')\n const [value, setValue] = useState(sessionStorage.getItem('subType'))\n\n const navigate = useNavigate()\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n update()\n navigate(newValue)\n sessionStorage.setItem('subType', newValue)\n }\n\n const handleChange = (event) => {\n setSearchTerm(event.target.value)\n }\n\n const filter = (registration) => {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n return modelName.includes(searchTerm.toLowerCase())\n }\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return\n\n try {\n setIsCallingApi(true)\n\n const rerankResponse = await fetcher(\n `${endPoint}/v1/model_registrations/rerank`,\n {\n method: 'GET',\n }\n )\n const rerankRegistrations = await rerankResponse.json()\n const customRerankRegistrations = rerankRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const embeddingResponse = await fetcher(\n `${endPoint}/v1/model_registrations/embedding`,\n {\n method: 'GET',\n }\n )\n\n const embeddingRegistrations = await embeddingResponse.json()\n const customEmbeddingRegistrations = embeddingRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const llmResponse = await fetcher(\n `${endPoint}/v1/model_registrations/LLM`,\n {\n method: 'GET',\n }\n )\n const llmRegistrations = await llmResponse.json()\n const customLLMRegistrations = llmRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const newEmbeddingData = await Promise.all(\n customEmbeddingRegistrations.map(async (registration) => {\n const desc = await fetcher(\n `${endPoint}/v1/model_registrations/embedding/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n const newLLMData = await Promise.all(\n customLLMRegistrations.map(async (registration) => {\n const desc = await fetcher(\n `${endPoint}/v1/model_registrations/LLM/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n const newRerankData = await Promise.all(\n customRerankRegistrations.map(async (registration) => {\n const desc = await fetcher(\n `${endPoint}/v1/model_registrations/rerank/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n setRegistrationData(\n newLLMData.concat(newEmbeddingData).concat(newRerankData)\n )\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [])\n\n const style = {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n paddingBottom: '2rem',\n gridGap: '2rem 0rem',\n }\n\n return (\n <Box m=\"20px\">\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label=\"Language Models\" value=\"/launch_model/custom/llm\" />\n <Tab\n label=\"Embedding Models\"\n value=\"/launch_model/custom/embedding\"\n />\n <Tab label=\"Rerank Models\" value=\"/launch_model/custom/rerank\" />\n </TabList>\n </Box>\n <TabPanel value=\"/launch_model/custom/llm\" sx={{ padding: 0 }}>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for custom model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => {\n if (\n !(\n filteredRegistration.max_tokens &&\n filteredRegistration.dimensions\n ) &&\n !(\n filteredRegistration.model_type &&\n filteredRegistration.model_type === 'rerank'\n )\n ) {\n return (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n is_custom={true}\n modelType=\"LLM\"\n />\n )\n }\n })}\n </div>\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/embedding\" sx={{ padding: 0 }}>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for custom model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => {\n if (\n filteredRegistration.max_tokens &&\n filteredRegistration.dimensions\n ) {\n return (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n is_custom={true}\n modelType=\"embedding\"\n />\n )\n }\n })}\n </div>\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/rerank\" sx={{ padding: 0 }}>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label=\"Search for custom model name\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n hotkey=\"/\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => {\n if (\n filteredRegistration.model_type &&\n filteredRegistration.model_type === 'rerank'\n ) {\n return (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n is_custom={true}\n modelType=\"rerank\"\n />\n )\n }\n })}\n </div>\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default LaunchCustom\n"],"mappings":"mkBAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,WAAW,CAAEC,GAAG,KAAQ,eAAe,CACrD,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,SAAS,KAAM,aAAa,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEnC,GAAM,CAAAC,YAAY,CAAG,QAAf,CAAAA,YAAYA,CAAAC,IAAA,CAAyB,IAAnB,CAAAC,YAAY,CAAAD,IAAA,CAAZC,YAAY,CAClC,GAAI,CAAAC,QAAQ,CAAGf,UAAU,CAACI,UAAU,CAAC,CAACW,QAAQ,CAC9C,IAAAC,SAAA,CAAgDd,QAAQ,CAAC,EAAE,CAAC,CAAAe,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAArDG,gBAAgB,CAAAF,UAAA,IAAEG,mBAAmB,CAAAH,UAAA,IAC5C,IAAAI,WAAA,CAA0CrB,UAAU,CAACI,UAAU,CAAC,CAAxDkB,YAAY,CAAAD,WAAA,CAAZC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CAAC,SAACmD,oBAAoB,CAAK,CAC7B,GACEA,oBAAoB,CAACG,UAAU,EAC/BH,oBAAoB,CAACG,UAAU,GAAK,QAAQ,CAC5C,CACA,mBACE9H,IAAA,CAACF,SAAS,EAERiI,GAAG,CAAEzH,QAAS,CACd0H,SAAS,CAAEL,oBAAqB,CAChCM,SAAS,CAAE,IAAK,CAChBC,SAAS,CAAC,QAAQ,EAJbP,oBAAoB,CAACrF,UAK3B,CAAC,CAEN,CACF,CAAC,CAAC,CACD,CAAC,EACE,CAAC,EACD,CAAC,CACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAnC,YAAY"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";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{AddCircle}from'@mui/icons-material';import DeleteIcon from'@mui/icons-material/Delete';import{Alert,Box,IconButton,Snackbar,TextField}from'@mui/material';import React,{useEffect,useState}from'react';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var AddPair=function AddPair(_ref){var customData=_ref.customData,onGetArr=_ref.onGetArr,onJudgeArr=_ref.onJudgeArr;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),openSnackbar=_useState2[0],setOpenSnackbar=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),arr=_useState4[0],setArr=_useState4[1];var _useState5=useState(0),_useState6=_slicedToArray(_useState5,2),arrId=_useState6[0],setArrId=_useState6[1];var _useState7=useState(-1),_useState8=_slicedToArray(_useState7,2),defaultIndex=_useState8[0],setDefaultIndex=_useState8[1];var _useState9=useState(false),_useState10=_slicedToArray(_useState9,2),isNotUniqueKey=_useState10[0],setIsNotUniqueKey=_useState10[1];useEffect(function(){onGetArr(arr);},[arr]);var updateArr=function updateArr(index,type,newValue){setArr(arr.map(function(pair,subIndex){if(subIndex===index){return _objectSpread(_objectSpread({},pair),{},_defineProperty({},type,newValue));}return pair;}));if(type===customData.key){setDefaultIndex(-1);setIsNotUniqueKey(false);arr.forEach(function(pair){if(pair[customData.key]===newValue){setDefaultIndex(index);setIsNotUniqueKey(true);}});}};var handleDeleteArr=function handleDeleteArr(index){setDefaultIndex(-1);setArr(arr.filter(function(_,subIndex){return index!==subIndex;}));onGetArr(arr);};return/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(Box,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'flex',alignItems:'center',margin:'20px 0 0 15px'},children:[/*#__PURE__*/_jsx(\"div\",{children:customData.title}),/*#__PURE__*/_jsx(IconButton,{color:\"primary\",onClick:function onClick(){setArrId(arrId+1);var obj={id:arrId};obj[customData.key]='';obj[customData.value]='';onJudgeArr(arr,[customData.key,customData.value])?setArr([].concat(_toConsumableArray(arr),[obj])):setOpenSnackbar(true);},children:/*#__PURE__*/_jsx(AddCircle,{})})]}),/*#__PURE__*/_jsx(Box,{children:arr.map(function(item,index){return/*#__PURE__*/_jsxs(Box,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'flex',justifyContent:'space-between',alignItems:'center',marginTop:'10px',marginLeft:'10px'},children:[/*#__PURE__*/_jsx(TextField,{label:customData.key,value:item[customData.key],onChange:function onChange(e){updateArr(index,customData.key,e.target.value);},style:{width:'44%'}}),/*#__PURE__*/_jsx(TextField,{label:customData.value,value:item[customData.value],onChange:function onChange(e){updateArr(index,customData.value,e.target.value);},style:{width:'44%'}}),/*#__PURE__*/_jsx(IconButton,{\"aria-label\":\"delete\",onClick:function onClick(){return handleDeleteArr(index);},style:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(DeleteIcon,{})})]}),isNotUniqueKey&&defaultIndex===index&&/*#__PURE__*/_jsxs(Alert,{severity:\"error\",children:[customData.key,\" must be unique\"]})]},item.id);})})]}),/*#__PURE__*/_jsx(Snackbar,{anchorOrigin:{vertical:'top',horizontal:'center'},open:openSnackbar,onClose:function onClose(){return setOpenSnackbar(false);},message:\"Please fill in the complete parameters before adding!!\"},'top'+'center')]});};export default AddPair;","map":{"version":3,"names":["AddCircle","DeleteIcon","Alert","Box","IconButton","Snackbar","TextField","React","useEffect","useState","jsx","_jsx","jsxs","_jsxs","AddPair","_ref","customData","onGetArr","onJudgeArr","_useState","_useState2","_slicedToArray","openSnackbar","setOpenSnackbar","_useState3","_useState4","arr","setArr","_useState5","_useState6","arrId","setArrId","_useState7","_useState8","defaultIndex","setDefaultIndex","_useState9","_useState10","isNotUniqueKey","setIsNotUniqueKey","updateArr","index","type","newValue","map","pair","subIndex","_objectSpread","_defineProperty","key","forEach","handleDeleteArr","filter","_","children","style","display","alignItems","margin","title","color","onClick","obj","id","value","concat","_toConsumableArray","item","justifyContent","marginTop","marginLeft","label","onChange","e","target","width","severity","anchorOrigin","vertical","horizontal","open","onClose","message"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/components/addPair.js"],"sourcesContent":["import { AddCircle } from '@mui/icons-material'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport { Alert, Box, IconButton, Snackbar, TextField } from '@mui/material'\nimport React, { useEffect, useState } from 'react'\n\nconst AddPair = ({ customData, onGetArr, onJudgeArr }) => {\n const [openSnackbar, setOpenSnackbar] = useState(false)\n const [arr, setArr] = useState([])\n const [arrId, setArrId] = useState(0)\n const [defaultIndex, setDefaultIndex] = useState(-1)\n const [isNotUniqueKey, setIsNotUniqueKey] = useState(false)\n\n useEffect(() => {\n onGetArr(arr)\n }, [arr])\n\n const updateArr = (index, type, newValue) => {\n setArr(\n arr.map((pair, subIndex) => {\n if (subIndex === index) {\n return { ...pair, [type]: newValue }\n }\n return pair\n })\n )\n if (type === customData.key) {\n setDefaultIndex(-1)\n setIsNotUniqueKey(false)\n arr.forEach((pair) => {\n if (pair[customData.key] === newValue) {\n setDefaultIndex(index)\n setIsNotUniqueKey(true)\n }\n })\n }\n }\n\n const handleDeleteArr = (index) => {\n setDefaultIndex(-1)\n setArr(\n arr.filter((_, subIndex) => {\n return index !== subIndex\n })\n )\n onGetArr(arr)\n }\n\n return (\n <div>\n <Box>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n margin: '20px 0 0 15px',\n }}\n >\n <div>{customData.title}</div>\n <IconButton\n color=\"primary\"\n onClick={() => {\n setArrId(arrId + 1)\n let obj = { id: arrId }\n obj[customData.key] = ''\n obj[customData.value] = ''\n onJudgeArr(arr, [customData.key, customData.value])\n ? setArr([...arr, obj])\n : setOpenSnackbar(true)\n }}\n >\n <AddCircle />\n </IconButton>\n </div>\n <Box>\n {arr.map((item, index) => {\n return (\n <Box key={item.id}>\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginTop: '10px',\n marginLeft: '10px',\n }}\n >\n <TextField\n label={customData.key}\n value={item[customData.key]}\n onChange={(e) => {\n updateArr(index, customData.key, e.target.value)\n }}\n style={{ width: '44%' }}\n />\n <TextField\n label={customData.value}\n value={item[customData.value]}\n onChange={(e) => {\n updateArr(index, customData.value, e.target.value)\n }}\n style={{ width: '44%' }}\n />\n <IconButton\n aria-label=\"delete\"\n onClick={() => handleDeleteArr(index)}\n style={{ marginLeft: '10px' }}\n >\n <DeleteIcon />\n </IconButton>\n </div>\n {isNotUniqueKey && defaultIndex === index && (\n <Alert severity=\"error\">\n {customData.key} must be unique\n </Alert>\n )}\n </Box>\n )\n })}\n </Box>\n </Box>\n <Snackbar\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n open={openSnackbar}\n onClose={() => setOpenSnackbar(false)}\n message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xDC,IAAI,CAAE1D,YAAa,CACnB2D,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAA1D,eAAe,CAAC,KAAK,CAAC,EAAC,CACtC2D,OAAO,CAAC,wDAAwD,EAC3D,KAAK,CAAG,QACd,CAAC,EACC,CAAC,CAEV,CAAC,CAED,cAAe,CAAApE,OAAO"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.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{ChatOutlined,EditNoteOutlined,ExpandLess,ExpandMore,HelpCenterOutlined,RocketLaunchOutlined,UndoOutlined}from'@mui/icons-material';import DeleteIcon from'@mui/icons-material/Delete';import{Alert,Box,Chip,CircularProgress,Collapse,Drawer,FormControl,Grid,IconButton,InputLabel,ListItemButton,ListItemText,MenuItem,Select,Snackbar,Stack,TextField}from'@mui/material';import Paper from'@mui/material/Paper';import React,{useContext,useEffect,useRef,useState}from'react';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import TitleTypography from'../../components/titleTypography';import AddPair from'./components/addPair';import styles from'./styles/modelCardStyle';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var ModelCard=function ModelCard(_ref){var url=_ref.url,modelData=_ref.modelData,gpuAvailable=_ref.gpuAvailable,modelType=_ref.modelType,_ref$is_custom=_ref.is_custom,is_custom=_ref$is_custom===void 0?false:_ref$is_custom;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hover=_useState2[0],setHover=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),selected=_useState4[0],setSelected=_useState4[1];var _useState5=useState(false),_useState6=_slicedToArray(_useState5,2),requestLimitsAlert=_useState6[0],setRequestLimitsAlert=_useState6[1];var _useState7=useState(false),_useState8=_slicedToArray(_useState7,2),GPUIdxAlert=_useState8[0],setGPUIdxAlert=_useState8[1];var _useState9=useState(false),_useState10=_slicedToArray(_useState9,2),isOther=_useState10[0],setIsOther=_useState10[1];var _useState11=useState(false),_useState12=_slicedToArray(_useState11,2),isPeftModelConfig=_useState12[0],setIsPeftModelConfig=_useState12[1];var _useState13=useState(false),_useState14=_slicedToArray(_useState13,2),openSnackbar=_useState14[0],setOpenSnackbar=_useState14[1];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 navigate=useNavigate();// Model parameter selections\nvar _useState15=useState(''),_useState16=_slicedToArray(_useState15,2),modelUID=_useState16[0],setModelUID=_useState16[1];var _useState17=useState(''),_useState18=_slicedToArray(_useState17,2),modelFormat=_useState18[0],setModelFormat=_useState18[1];var _useState19=useState(''),_useState20=_slicedToArray(_useState19,2),modelSize=_useState20[0],setModelSize=_useState20[1];var _useState21=useState(''),_useState22=_slicedToArray(_useState21,2),quantization=_useState22[0],setQuantization=_useState22[1];var _useState23=useState('auto'),_useState24=_slicedToArray(_useState23,2),nGPU=_useState24[0],setNGPU=_useState24[1];var _useState25=useState(-1),_useState26=_slicedToArray(_useState25,2),nGPULayers=_useState26[0],setNGPULayers=_useState26[1];var _useState27=useState(1),_useState28=_slicedToArray(_useState27,2),replica=_useState28[0],setReplica=_useState28[1];var _useState29=useState(''),_useState30=_slicedToArray(_useState29,2),requestLimits=_useState30[0],setRequestLimits=_useState30[1];var _useState31=useState(''),_useState32=_slicedToArray(_useState31,2),workerIp=_useState32[0],setWorkerIp=_useState32[1];var _useState33=useState(''),_useState34=_slicedToArray(_useState33,2),GPUIdx=_useState34[0],setGPUIdx=_useState34[1];var _useState35=useState([]),_useState36=_slicedToArray(_useState35,2),formatOptions=_useState36[0],setFormatOptions=_useState36[1];var _useState37=useState([]),_useState38=_slicedToArray(_useState37,2),sizeOptions=_useState38[0],setSizeOptions=_useState38[1];var _useState39=useState([]),_useState40=_slicedToArray(_useState39,2),quantizationOptions=_useState40[0],setQuantizationOptions=_useState40[1];var _useState41=useState(false),_useState42=_slicedToArray(_useState41,2),customDeleted=_useState42[0],setCustomDeleted=_useState42[1];var _useState43=useState([]),_useState44=_slicedToArray(_useState43,2),customParametersArr=_useState44[0],setCustomParametersArr=_useState44[1];var _useState45=useState([]),_useState46=_slicedToArray(_useState45,2),loraListArr=_useState46[0],setLoraListArr=_useState46[1];var _useState47=useState([]),_useState48=_slicedToArray(_useState47,2),imageLoraLoadKwargsArr=_useState48[0],setImageLoraLoadKwargsArr=_useState48[1];var _useState49=useState([]),_useState50=_slicedToArray(_useState49,2),imageLoraFuseKwargsArr=_useState50[0],setImageLoraFuseKwargsArr=_useState50[1];var parentRef=useRef(null);var range=function range(start,end){return new Array(end-start+1).fill(undefined).map(function(_,i){return i+start;});};var isCached=function isCached(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;});}};// model size can be int or string. For string style, \"1_8\" means 1.8 as an example.\nvar convertModelSize=function convertModelSize(size){return size.toString().includes('_')?size:parseInt(size,10);};// UseEffects for parameter selection, change options based on previous selections\nuseEffect(function(){if(modelData){if(modelData.model_specs){var modelFamily=modelData.model_specs;var formats=_toConsumableArray(new Set(modelFamily.map(function(spec){return spec.model_format;})));setFormatOptions(formats);}}},[modelData]);useEffect(function(){if(modelFormat&&modelData){var modelFamily=modelData.model_specs;var sizes=_toConsumableArray(new Set(modelFamily.filter(function(spec){return spec.model_format===modelFormat;}).map(function(spec){return spec.model_size_in_billions;})));setSizeOptions(sizes);}},[modelFormat,modelData]);useEffect(function(){if(modelFormat&&modelSize&&modelData){var modelFamily=modelData.model_specs;var quants=_toConsumableArray(new Set(modelFamily.filter(function(spec){return spec.model_format===modelFormat&&spec.model_size_in_billions===convertModelSize(modelSize);}).flatMap(function(spec){return spec.quantizations;})));setQuantizationOptions(quants);}},[modelFormat,modelSize,modelData]);useEffect(function(){if(parentRef.current){parentRef.current.scrollTo({top:parentRef.current.scrollHeight,behavior:'smooth'});}},[customParametersArr]);var getNGPURange=function getNGPURange(){if(gpuAvailable===0){// remain 'auto' for distributed situation\nreturn['auto','CPU'];}return['auto','CPU'].concat(range(1,gpuAvailable));};var launchModel=function launchModel(url){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);var modelDataWithID_LLM={// If user does not fill model_uid, pass null (None) to server and server generates it.\nmodel_uid:modelUID.trim()===''?null:modelUID.trim(),model_name:modelData.model_name,model_type:modelType,model_format:modelFormat,model_size_in_billions:convertModelSize(modelSize),quantization:quantization,n_gpu:parseInt(nGPU,10)===0||nGPU==='CPU'?null:nGPU==='auto'?'auto':parseInt(nGPU,10),replica:replica,request_limits:requestLimits.trim()===''?null:Number(requestLimits.trim()),worker_ip:workerIp.trim()===''?null:workerIp.trim(),gpu_idx:GPUIdx.trim()===''?null:handleGPUIdx(GPUIdx.trim())};var modelDataWithID_other={model_uid:modelUID.trim()===''?null:modelUID.trim(),model_name:modelData.model_name,model_type:modelType};if(nGPULayers>=0){modelDataWithID_LLM.n_gpu_layers=nGPULayers;}if(loraListArr.length||imageLoraLoadKwargsArr.length||imageLoraFuseKwargsArr.length){var peft_model_config={};if(imageLoraLoadKwargsArr.length){var image_lora_load_kwargs={};imageLoraLoadKwargsArr.forEach(function(item){image_lora_load_kwargs[item.key]=handleValueType(item.value);});peft_model_config['image_lora_load_kwargs']=image_lora_load_kwargs;}if(imageLoraFuseKwargsArr.length){var image_lora_fuse_kwargs={};imageLoraFuseKwargsArr.forEach(function(item){image_lora_fuse_kwargs[item.key]=handleValueType(item.value);});peft_model_config['image_lora_fuse_kwargs']=image_lora_fuse_kwargs;}if(loraListArr.length){var lora_list=loraListArr;lora_list.map(function(item){delete item.id;});peft_model_config['lora_list']=lora_list;}modelDataWithID_LLM['peft_model_config']=peft_model_config;}if(customParametersArr.length){customParametersArr.forEach(function(item){modelDataWithID_LLM[item.key]=handleValueType(item.value);});}var modelDataWithID=modelType==='LLM'?modelDataWithID_LLM:modelType==='embedding'||modelType==='rerank'?_objectSpread(_objectSpread({},modelDataWithID_other),{},{replica:replica}):modelDataWithID_other;// First fetcher request to initiate the model\nfetcher(url+'/v1/models',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(modelDataWithID)}).then(function(response){if(!response.ok){// Assuming the server returns error details in JSON format\nresponse.json().then(function(errorData){setErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{navigate(\"/running_models/\".concat(modelType));sessionStorage.setItem('runningModelType',\"/running_models/\".concat(modelType));}setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});};var handleGPUIdx=function handleGPUIdx(data){var arr=[];data.split(',').forEach(function(item){arr.push(Number(item));});return arr;};var handeCustomDelete=function handeCustomDelete(e){e.stopPropagation();fetcher(url+\"/v1/model_registrations/LLM/\".concat(modelData.model_name),{method:'DELETE',headers:{'Content-Type':'application/json'}}).then(function(){setCustomDeleted(true);}).catch(console.error);};var judgeArr=function judgeArr(arr,keysArr){if(arr.length&&arr[arr.length-1][keysArr[0]]!==''&&arr[arr.length-1][keysArr[1]]!==''){return true;}else if(arr.length===0){return true;}else{return false;}};var handleValueType=function handleValueType(str){if(str.toLowerCase()==='none'){return null;}else if(str.toLowerCase()==='true'){return true;}else if(str.toLowerCase()==='false'){return false;}else if(Number(str)||str!==''&&Number(str)===0){return Number(str);}else{return str;}};var getLoraListArr=function getLoraListArr(arr){setLoraListArr(arr);};var getImageLoraLoadKwargsArr=function getImageLoraLoadKwargsArr(arr){setImageLoraLoadKwargsArr(arr);};var getImageLoraFuseKwargsArr=function getImageLoraFuseKwargsArr(arr){setImageLoraFuseKwargsArr(arr);};var getCustomParametersArr=function getCustomParametersArr(arr){setCustomParametersArr(arr);};// Set two different states based on mouse hover\nreturn/*#__PURE__*/_jsxs(Paper,{style:hover?styles.containerSelected:styles.container,onMouseEnter:function onMouseEnter(){return setHover(true);},onMouseLeave:function onMouseLeave(){return setHover(false);},onClick:function onClick(){if(!selected&&!customDeleted){setSelected(true);}},elevation:hover?24:4,children:[modelType==='LLM'?/*#__PURE__*/_jsxs(Box,{style:styles.descriptionCard,children:[is_custom&&/*#__PURE__*/_jsxs(Stack,{direction:\"row\",spacing:1,useFlexGap:true,children:[/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsx(IconButton,{\"aria-label\":\"delete\",onClick:handeCustomDelete,disabled:customDeleted,children:/*#__PURE__*/_jsx(DeleteIcon,{})})]}),!is_custom&&/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsxs(Stack,{spacing:1,direction:\"row\",useFlexGap:true,flexWrap:\"wrap\",sx:{marginLeft:1},children:[function(){return modelData.model_lang.map(function(v){return/*#__PURE__*/_jsx(Chip,{label:v,variant:\"outlined\",size:\"small\"},v);});}(),function(){if(modelData.model_specs.some(function(spec){return isCached(spec);})){return/*#__PURE__*/_jsx(Chip,{label:\"Cached\",variant:\"outlined\",size:\"small\"});}}(),function(){if(is_custom&&customDeleted){return/*#__PURE__*/_jsx(Chip,{label:\"Deleted\",variant:\"outlined\",size:\"small\"});}}()]}),modelData.model_description&&/*#__PURE__*/_jsx(\"p\",{style:styles.p,title:modelData.model_description,children:modelData.model_description}),/*#__PURE__*/_jsxs(\"div\",{style:styles.iconRow,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsxs(\"span\",{style:styles.boldIconText,children:[Math.floor(modelData.context_length/1000),\"K\"]}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"context length\"})]}),function(){if(modelData.model_ability.includes('chat')){return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(ChatOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"chat model\"})]});}else if(modelData.model_ability.includes('generate')){return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(EditNoteOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"generate model\"})]});}else{return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(HelpCenterOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"other model\"})]});}}()]})]}):/*#__PURE__*/_jsxs(Box,{style:styles.descriptionCard,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.titleContainer,children:[is_custom&&/*#__PURE__*/_jsxs(Stack,{direction:\"row\",spacing:1,useFlexGap:true,children:[/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsx(IconButton,{\"aria-label\":\"delete\",onClick:handeCustomDelete,disabled:customDeleted,children:/*#__PURE__*/_jsx(DeleteIcon,{})})]}),!is_custom&&/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsxs(Stack,{spacing:1,direction:\"row\",useFlexGap:true,flexWrap:\"wrap\",sx:{marginLeft:1},children:[function(){if(modelData.language){return modelData.language.map(function(v){return/*#__PURE__*/_jsx(Chip,{label:v,variant:\"outlined\",size:\"small\"});});}else if(modelData.model_family){return/*#__PURE__*/_jsx(Chip,{label:modelData.model_family,variant:\"outlined\",size:\"small\"});}}(),function(){if(modelData.cache_status){return/*#__PURE__*/_jsx(Chip,{label:\"Cached\",variant:\"outlined\",size:\"small\"});}}(),function(){if(is_custom&&customDeleted){return/*#__PURE__*/_jsx(Chip,{label:\"Deleted\",variant:\"outlined\",size:\"small\"});}}()]})]}),modelData.dimensions&&/*#__PURE__*/_jsxs(\"div\",{style:styles.iconRow,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(\"span\",{style:styles.boldIconText,children:modelData.dimensions}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"dimensions\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(\"span\",{style:styles.boldIconText,children:modelData.max_tokens}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"max tokens\"})]})]}),!selected&&hover&&/*#__PURE__*/_jsx(\"p\",{style:styles.instructionText,children:\"Click with mouse to launch the model\"})]}),/*#__PURE__*/_jsx(Drawer,{open:selected,onClose:function onClose(){return setSelected(false);},anchor:'right',children:/*#__PURE__*/_jsxs(\"div\",{style:styles.drawerCard,children:[/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),modelType==='LLM'?/*#__PURE__*/_jsx(Box,{ref:parentRef,style:styles.formContainer,display:\"flex\",flexDirection:\"column\",width:\"100%\",mx:\"auto\",children:/*#__PURE__*/_jsxs(Grid,{rowSpacing:0,columnSpacing:1,children:[/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"modelFormat-label\",children:\"Model Format\"}),/*#__PURE__*/_jsx(Select,{labelId:\"modelFormat-label\",value:modelFormat,onChange:function onChange(e){return setModelFormat(e.target.value);},label:\"Model Format\",children:formatOptions.map(function(format){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===format;});var cached=specs.some(function(spec){return isCached(spec);});var displayedFormat=cached?format+' (cached)':format;return/*#__PURE__*/_jsx(MenuItem,{value:format,children:displayedFormat},format);})})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,disabled:!modelFormat,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"modelSize-label\",children:\"Model Size\"}),/*#__PURE__*/_jsx(Select,{labelId:\"modelSize-label\",value:modelSize,onChange:function onChange(e){return setModelSize(e.target.value);},label:\"Model Size\",children:sizeOptions.map(function(size){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===size;});var cached=specs.some(function(spec){return isCached(spec);});var displayedSize=cached?size+' (cached)':size;return/*#__PURE__*/_jsx(MenuItem,{value:size,children:displayedSize},size);})})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,disabled:!modelFormat||!modelSize,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"quantization-label\",children:\"Quantization\"}),/*#__PURE__*/_jsx(Select,{labelId:\"quantization-label\",value:quantization,onChange:function onChange(e){return setQuantization(e.target.value);},label:\"Quantization\",children:quantizationOptions.map(function(quant,index){var _specs$0$cache_status,_specs$,_specs$0$cache_status2,_specs$2,_specs$2$cache_status;var specs=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===convertModelSize(modelSize);});var cached=modelFormat==='pytorch'?(_specs$0$cache_status=(_specs$=specs[0])===null||_specs$===void 0?void 0:_specs$.cache_status)!==null&&_specs$0$cache_status!==void 0?_specs$0$cache_status:false===true:(_specs$0$cache_status2=(_specs$2=specs[0])===null||_specs$2===void 0?void 0:(_specs$2$cache_status=_specs$2.cache_status)===null||_specs$2$cache_status===void 0?void 0:_specs$2$cache_status[index])!==null&&_specs$0$cache_status2!==void 0?_specs$0$cache_status2:false===true;var displayedQuant=cached?quant+' (cached)':quant;return/*#__PURE__*/_jsx(MenuItem,{value:quant,children:displayedQuant},quant);})})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:modelFormat!=='ggufv2'&&modelFormat!=='ggmlv3'?/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,disabled:!modelFormat||!modelSize||!quantization,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"n-gpu-label\",children:\"N-GPU\"}),/*#__PURE__*/_jsx(Select,{labelId:\"n-gpu-label\",value:nGPU,onChange:function onChange(e){return setNGPU(e.target.value);},label:\"N-GPU\",children:getNGPURange().map(function(v){return/*#__PURE__*/_jsx(MenuItem,{value:v,children:v},v);})})]}):/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{disabled:!modelFormat||!modelSize||!quantization,type:\"number\",label:\"N GPU Layers\",InputProps:{inputProps:{min:-1}},value:nGPULayers,onChange:function onChange(e){return setNGPULayers(parseInt(e.target.value,10));}})})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{disabled:!modelFormat||!modelSize||!quantization,type:\"number\",InputProps:{inputProps:{min:1}},label:\"Replica\",value:replica,onChange:function onChange(e){return setReplica(parseInt(e.target.value,10));}})})}),/*#__PURE__*/_jsxs(ListItemButton,{onClick:function onClick(){return setIsOther(!isOther);},children:[/*#__PURE__*/_jsx(ListItemText,{primary:\"Optional Configurations\"}),isOther?/*#__PURE__*/_jsx(ExpandLess,{}):/*#__PURE__*/_jsx(ExpandMore,{})]}),/*#__PURE__*/_jsxs(Collapse,{in:isOther,timeout:\"auto\",unmountOnExit:true,children:[/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{variant:\"outlined\",value:modelUID,label:\"(Optional) Model UID, model name by default\",onChange:function onChange(e){return setModelUID(e.target.value);}})})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:[/*#__PURE__*/_jsx(TextField,{value:requestLimits,label:\"(Optional) Request Limits, the number of request limits for this model\\uFF0Cdefault is None\",onChange:function onChange(e){setRequestLimitsAlert(false);setRequestLimits(e.target.value);if(e.target.value!==''&&(!Number(e.target.value)||Number(e.target.value)<1||parseInt(e.target.value)!==parseFloat(e.target.value))){setRequestLimitsAlert(true);}}}),requestLimitsAlert&&/*#__PURE__*/_jsx(Alert,{severity:\"error\",children:\"Please enter an integer greater than 0\"})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{variant:\"outlined\",value:workerIp,label:\"(Optional) Worker Ip, specify the worker ip where the model is located in a distributed scenario\",onChange:function onChange(e){return setWorkerIp(e.target.value);}})})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:12,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:[/*#__PURE__*/_jsx(TextField,{value:GPUIdx,label:\"(Optional) GPU Idx, Specify the GPU index where the model is located\",onChange:function onChange(e){setGPUIdxAlert(false);setGPUIdx(e.target.value);var regular=/^\\d+(?:,\\d+)*$/;if(e.target.value!==''&&!regular.test(e.target.value)){setGPUIdxAlert(true);}}}),GPUIdxAlert&&/*#__PURE__*/_jsx(Alert,{severity:\"error\",children:\"Please enter numeric data separated by commas, for example: 0,1,2\"})]})}),/*#__PURE__*/_jsxs(ListItemButton,{onClick:function onClick(){return setIsPeftModelConfig(!isPeftModelConfig);},children:[/*#__PURE__*/_jsx(ListItemText,{primary:\"Lora Config\"}),isPeftModelConfig?/*#__PURE__*/_jsx(ExpandLess,{}):/*#__PURE__*/_jsx(ExpandMore,{})]}),/*#__PURE__*/_jsxs(Collapse,{in:isPeftModelConfig,timeout:\"auto\",unmountOnExit:true,style:{marginLeft:'30px'},children:[/*#__PURE__*/_jsx(AddPair,{customData:{title:'Lora Model Config',key:'lora_name',value:'local_path'},onGetArr:getLoraListArr,onJudgeArr:judgeArr}),/*#__PURE__*/_jsx(AddPair,{customData:{title:'Lora Load Kwargs for Image Model',key:'key',value:'value'},onGetArr:getImageLoraLoadKwargsArr,onJudgeArr:judgeArr}),/*#__PURE__*/_jsx(AddPair,{customData:{title:'Lora Fuse Kwargs for Image Model',key:'key',value:'value'},onGetArr:getImageLoraFuseKwargsArr,onJudgeArr:judgeArr})]})]}),/*#__PURE__*/_jsx(AddPair,{customData:{title:'Additional parameters passed to the inference engine',key:'key',value:'value'},onGetArr:getCustomParametersArr,onJudgeArr:judgeArr})]})}):/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:[/*#__PURE__*/_jsx(TextField,{variant:\"outlined\",value:modelUID,label:\"(Optional) Model UID, model name by default\",onChange:function onChange(e){return setModelUID(e.target.value);}}),(modelType==='embedding'||modelType==='rerank')&&/*#__PURE__*/_jsx(TextField,{style:{marginTop:'25px'},type:\"number\",InputProps:{inputProps:{min:1}},label:\"Replica\",value:replica,onChange:function onChange(e){return setReplica(parseInt(e.target.value,10));}})]}),/*#__PURE__*/_jsxs(Box,{style:styles.buttonsContainer,children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch\",style:styles.buttonContainer,onClick:function onClick(){return launchModel(url,modelData);},disabled:modelType==='LLM'&&(isCallingApi||isUpdatingModel||!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!=='pytorch'))||!judgeArr(customParametersArr,['key','value'])||!judgeArr(loraListArr,['lora_name','local_path'])||!judgeArr(imageLoraLoadKwargsArr,['key','value'])||!judgeArr(imageLoraFuseKwargsArr,['key','value'])||requestLimitsAlert||GPUIdxAlert),children:function(){if(isCallingApi||isUpdatingModel){return/*#__PURE__*/_jsx(Box,{style:_objectSpread(_objectSpread({},styles.buttonItem),{},{backgroundColor:'#f2f2f2'}),children:/*#__PURE__*/_jsx(CircularProgress,{size:\"20px\",sx:{color:'#000000'}})});}else if(!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!=='pytorch'))){return/*#__PURE__*/_jsx(Box,{style:_objectSpread(_objectSpread({},styles.buttonItem),{},{backgroundColor:'#f2f2f2'}),children:/*#__PURE__*/_jsx(RocketLaunchOutlined,{size:\"20px\"})});}else{return/*#__PURE__*/_jsx(Box,{style:styles.buttonItem,children:/*#__PURE__*/_jsx(RocketLaunchOutlined,{color:\"#000000\",size:\"20px\"})});}}()}),/*#__PURE__*/_jsx(\"button\",{title:\"Go Back\",style:styles.buttonContainer,onClick:function onClick(){return setSelected(false);},children:/*#__PURE__*/_jsx(Box,{style:styles.buttonItem,children:/*#__PURE__*/_jsx(UndoOutlined,{color:\"#000000\",size:\"20px\"})})})]})]})}),/*#__PURE__*/_jsx(Snackbar,{anchorOrigin:{vertical:'top',horizontal:'center'},open:openSnackbar,onClose:function onClose(){return setOpenSnackbar(false);},message:\"Please fill in the complete parameters before adding!!\"},'top'+'center')]});};export default ModelCard;","map":{"version":3,"names":["ChatOutlined","EditNoteOutlined","ExpandLess","ExpandMore","HelpCenterOutlined","RocketLaunchOutlined","UndoOutlined","DeleteIcon","Alert","Box","Chip","CircularProgress","Collapse","Drawer","FormControl","Grid","IconButton","InputLabel","ListItemButton","ListItemText","MenuItem","Select","Snackbar","Stack","TextField","Paper","React","useContext","useEffect","useRef","useState","useNavigate","ApiContext","fetcher","TitleTypography","AddPair","styles","jsx","_jsx","jsxs","_jsxs","ModelCard","_ref","url","modelData","gpuAvailable","modelType","_ref$is_custom","is_custom","_useState","_useState2","_slicedToArray","hover","setHover","_useState3","_useState4","selected","setSelected","_useState5","_useState6","requestLimitsAlert","setRequestLimitsAlert","_useState7","_useState8","GPUIdxAlert","setGPUIdxAlert","_useState9","_useState10","isOther","setIsOther","_useState11","_useState12","isPeftModelConfig","setIsPeftModelConfig","_useState13","_useState14","openSnackbar","setOpenSnackbar","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useContext3","setErrorMsg","navigate","_useState15","_useState16","modelUID","setModelUID","_useState17","_useState18","modelFormat","setModelFormat","_useState19","_useState20","modelSize","setModelSize","_useState21","_useState22","quantization","setQuantization","_useState23","_useState24","nGPU","setNGPU","_useState25","_useState26","nGPULayers","setNGPULayers","_useState27","_useState28","replica","setReplica","_useState29","_useState30","requestLimits","setRequestLimits","_useState31","_useState32","workerIp","setWorkerIp","_useState33","_useState34","GPUIdx","setGPUIdx","_useState35","_useState36","formatOptions","setFormatOptions","_useState37","_useState38","sizeOptions","setSizeOptions","_useState39","_useState40","quantizationOptions","setQuantizationOptions","_useState41","_useState42","customDeleted","setCustomDeleted","_useState43","_useState44","customParametersArr","setCustomParametersArr","_useState45","_useState46","loraListArr","setLoraListArr","_useState47","_useState48","imageLoraLoadKwargsArr","setImageLoraLoadKwargsArr","_useState49","_useState50","imageLoraFuseKwargsArr","setImageLoraFuseKwargsArr","parentRef","range","start","end","Array","fill","undefined","map","_","i","isCached","spec","model_format","cache_status","some","cs","convertModelSize","size","toString","includes","parseInt","model_specs","modelFamily","formats","_toConsumableArray","Set","sizes","filter","model_size_in_billions","quants","flatMap","quantizations","current","scrollTo","top","scrollHeight","behavior","getNGPURange","concat","launchModel","modelDataWithID_LLM","model_uid","trim","model_name","model_type","n_gpu","request_limits","Number","worker_ip","gpu_idx","handleGPUIdx","modelDataWithID_other","n_gpu_layers","length","peft_model_config","image_lora_load_kwargs","forEach","item","key","handleValueType","value","image_lora_fuse_kwargs","lora_list","id","modelDataWithID","_objectSpread","method","headers","body","JSON","stringify","then","response","ok","json","errorData","status","detail","sessionStorage","setItem","catch","error","console","data","arr","split","push","handeCustomDelete","e","stopPropagation","judgeArr","keysArr","str","toLowerCase","getLoraListArr","getImageLoraLoadKwargsArr","getImageLoraFuseKwargsArr","getCustomParametersArr","style","containerSelected","container","onMouseEnter","onMouseLeave","onClick","elevation","children","descriptionCard","direction","spacing","useFlexGap","disabled","flexWrap","sx","marginLeft","model_lang","v","label","variant","model_description","p","title","iconRow","iconItem","boldIconText","Math","floor","context_length","smallText","model_ability","muiIcon","titleContainer","language","model_family","dimensions","max_tokens","instructionText","open","onClose","anchor","drawerCard","ref","formContainer","display","flexDirection","width","mx","rowSpacing","columnSpacing","xs","margin","fullWidth","labelId","onChange","target","format","specs","cached","displayedFormat","displayedSize","quant","index","_specs$0$cache_status","_specs$","_specs$0$cache_status2","_specs$2","_specs$2$cache_status","displayedQuant","type","InputProps","inputProps","min","primary","in","timeout","unmountOnExit","parseFloat","severity","regular","test","customData","onGetArr","onJudgeArr","marginTop","buttonsContainer","buttonContainer","is_builtin","buttonItem","backgroundColor","color","anchorOrigin","vertical","horizontal","message"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/modelCard.js"],"sourcesContent":["import {\n ChatOutlined,\n EditNoteOutlined,\n ExpandLess,\n ExpandMore,\n HelpCenterOutlined,\n RocketLaunchOutlined,\n UndoOutlined,\n} from '@mui/icons-material'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport {\n Alert,\n Box,\n Chip,\n CircularProgress,\n Collapse,\n Drawer,\n FormControl,\n Grid,\n IconButton,\n InputLabel,\n ListItemButton,\n ListItemText,\n MenuItem,\n Select,\n Snackbar,\n Stack,\n TextField,\n} from '@mui/material'\nimport Paper from '@mui/material/Paper'\nimport React, { useContext, useEffect, useRef, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport TitleTypography from '../../components/titleTypography'\nimport AddPair from './components/addPair'\nimport styles from './styles/modelCardStyle'\n\nconst ModelCard = ({\n url,\n modelData,\n gpuAvailable,\n modelType,\n is_custom = false,\n}) => {\n const [hover, setHover] = useState(false)\n const [selected, setSelected] = useState(false)\n const [requestLimitsAlert, setRequestLimitsAlert] = useState(false)\n const [GPUIdxAlert, setGPUIdxAlert] = useState(false)\n const [isOther, setIsOther] = useState(false)\n const [isPeftModelConfig, setIsPeftModelConfig] = useState(false)\n const [openSnackbar, setOpenSnackbar] = useState(false)\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const navigate = useNavigate()\n\n // Model parameter selections\n const [modelUID, setModelUID] = useState('')\n const [modelFormat, setModelFormat] = useState('')\n const [modelSize, setModelSize] = useState('')\n const [quantization, setQuantization] = useState('')\n const [nGPU, setNGPU] = useState('auto')\n const [nGPULayers, setNGPULayers] = useState(-1)\n const [replica, setReplica] = useState(1)\n const [requestLimits, setRequestLimits] = useState('')\n const [workerIp, setWorkerIp] = useState('')\n const [GPUIdx, setGPUIdx] = useState('')\n\n const [formatOptions, setFormatOptions] = useState([])\n const [sizeOptions, setSizeOptions] = useState([])\n const [quantizationOptions, setQuantizationOptions] = useState([])\n const [customDeleted, setCustomDeleted] = useState(false)\n const [customParametersArr, setCustomParametersArr] = useState([])\n const [loraListArr, setLoraListArr] = useState([])\n const [imageLoraLoadKwargsArr, setImageLoraLoadKwargsArr] = useState([])\n const [imageLoraFuseKwargsArr, setImageLoraFuseKwargsArr] = useState([])\n\n const parentRef = useRef(null)\n\n const range = (start, end) => {\n return new Array(end - start + 1).fill(undefined).map((_, i) => i + start)\n }\n\n const isCached = (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 // model size can be int or string. For string style, \"1_8\" means 1.8 as an example.\n const convertModelSize = (size) => {\n return size.toString().includes('_') ? size : parseInt(size, 10)\n }\n\n // UseEffects for parameter selection, change options based on previous selections\n useEffect(() => {\n if (modelData) {\n if (modelData.model_specs) {\n const modelFamily = modelData.model_specs\n const formats = [\n ...new Set(modelFamily.map((spec) => spec.model_format)),\n ]\n setFormatOptions(formats)\n }\n }\n }, [modelData])\n\n useEffect(() => {\n if (modelFormat && modelData) {\n const modelFamily = modelData.model_specs\n const sizes = [\n ...new Set(\n modelFamily\n .filter((spec) => spec.model_format === modelFormat)\n .map((spec) => spec.model_size_in_billions)\n ),\n ]\n setSizeOptions(sizes)\n }\n }, [modelFormat, modelData])\n\n useEffect(() => {\n if (modelFormat && modelSize && modelData) {\n const modelFamily = modelData.model_specs\n const quants = [\n ...new Set(\n modelFamily\n .filter(\n (spec) =>\n spec.model_format === modelFormat &&\n spec.model_size_in_billions === convertModelSize(modelSize)\n )\n .flatMap((spec) => spec.quantizations)\n ),\n ]\n setQuantizationOptions(quants)\n }\n }, [modelFormat, modelSize, modelData])\n\n useEffect(() => {\n if (parentRef.current) {\n parentRef.current.scrollTo({\n top: parentRef.current.scrollHeight,\n behavior: 'smooth',\n })\n }\n }, [customParametersArr])\n\n const getNGPURange = () => {\n if (gpuAvailable === 0) {\n // remain 'auto' for distributed situation\n return ['auto', 'CPU']\n }\n return ['auto', 'CPU'].concat(range(1, gpuAvailable))\n }\n\n const launchModel = (url) => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n\n setIsCallingApi(true)\n\n const modelDataWithID_LLM = {\n // If user does not fill model_uid, pass null (None) to server and server generates it.\n model_uid: modelUID.trim() === '' ? null : modelUID.trim(),\n model_name: modelData.model_name,\n model_type: modelType,\n model_format: modelFormat,\n model_size_in_billions: convertModelSize(modelSize),\n quantization: quantization,\n n_gpu:\n parseInt(nGPU, 10) === 0 || nGPU === 'CPU'\n ? null\n : nGPU === 'auto'\n ? 'auto'\n : parseInt(nGPU, 10),\n replica: replica,\n request_limits:\n requestLimits.trim() === '' ? null : Number(requestLimits.trim()),\n worker_ip: workerIp.trim() === '' ? null : workerIp.trim(),\n gpu_idx: GPUIdx.trim() === '' ? null : handleGPUIdx(GPUIdx.trim()),\n }\n\n const modelDataWithID_other = {\n model_uid: modelUID.trim() === '' ? null : modelUID.trim(),\n model_name: modelData.model_name,\n model_type: modelType,\n }\n\n if (nGPULayers >= 0) {\n modelDataWithID_LLM.n_gpu_layers = nGPULayers\n }\n\n if (\n loraListArr.length ||\n imageLoraLoadKwargsArr.length ||\n imageLoraFuseKwargsArr.length\n ) {\n const peft_model_config = {}\n if (imageLoraLoadKwargsArr.length) {\n const image_lora_load_kwargs = {}\n imageLoraLoadKwargsArr.forEach((item) => {\n image_lora_load_kwargs[item.key] = handleValueType(item.value)\n })\n peft_model_config['image_lora_load_kwargs'] = image_lora_load_kwargs\n }\n if (imageLoraFuseKwargsArr.length) {\n const image_lora_fuse_kwargs = {}\n imageLoraFuseKwargsArr.forEach((item) => {\n image_lora_fuse_kwargs[item.key] = handleValueType(item.value)\n })\n peft_model_config['image_lora_fuse_kwargs'] = image_lora_fuse_kwargs\n }\n if (loraListArr.length) {\n const lora_list = loraListArr\n lora_list.map((item) => {\n delete item.id\n })\n peft_model_config['lora_list'] = lora_list\n }\n modelDataWithID_LLM['peft_model_config'] = peft_model_config\n }\n\n if (customParametersArr.length) {\n customParametersArr.forEach((item) => {\n modelDataWithID_LLM[item.key] = handleValueType(item.value)\n })\n }\n\n const modelDataWithID =\n modelType === 'LLM'\n ? modelDataWithID_LLM\n : modelType === 'embedding' || modelType === 'rerank'\n ? { ...modelDataWithID_other, replica }\n : modelDataWithID_other\n\n // First fetcher request to initiate the model\n fetcher(url + '/v1/models', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(modelDataWithID),\n })\n .then((response) => {\n if (!response.ok) {\n // Assuming the server returns error details in JSON format\n response.json().then((errorData) => {\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n navigate(`/running_models/${modelType}`)\n sessionStorage.setItem(\n 'runningModelType',\n `/running_models/${modelType}`\n )\n }\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }\n\n const handleGPUIdx = (data) => {\n const arr = []\n data.split(',').forEach((item) => {\n arr.push(Number(item))\n })\n return arr\n }\n\n const handeCustomDelete = (e) => {\n e.stopPropagation()\n fetcher(url + `/v1/model_registrations/LLM/${modelData.model_name}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n .then(() => {\n setCustomDeleted(true)\n })\n .catch(console.error)\n }\n\n const judgeArr = (arr, keysArr) => {\n if (\n arr.length &&\n arr[arr.length - 1][keysArr[0]] !== '' &&\n arr[arr.length - 1][keysArr[1]] !== ''\n ) {\n return true\n } else if (arr.length === 0) {\n return true\n } else {\n return false\n }\n }\n\n const handleValueType = (str) => {\n if (str.toLowerCase() === 'none') {\n return null\n } else if (str.toLowerCase() === 'true') {\n return true\n } else if (str.toLowerCase() === 'false') {\n return false\n } else if (Number(str) || (str !== '' && Number(str) === 0)) {\n return Number(str)\n } else {\n return str\n }\n }\n\n const getLoraListArr = (arr) => {\n setLoraListArr(arr)\n }\n\n const getImageLoraLoadKwargsArr = (arr) => {\n setImageLoraLoadKwargsArr(arr)\n }\n\n const getImageLoraFuseKwargsArr = (arr) => {\n setImageLoraFuseKwargsArr(arr)\n }\n\n const getCustomParametersArr = (arr) => {\n setCustomParametersArr(arr)\n }\n\n // Set two different states based on mouse hover\n return (\n <Paper\n style={hover ? styles.containerSelected : styles.container}\n onMouseEnter={() => setHover(true)}\n onMouseLeave={() => setHover(false)}\n onClick={() => {\n if (!selected && !customDeleted) {\n setSelected(true)\n }\n }}\n elevation={hover ? 24 : 4}\n >\n {modelType === 'LLM' ? (\n <Box style={styles.descriptionCard}>\n {is_custom && (\n <Stack direction=\"row\" spacing={1} useFlexGap>\n <TitleTypography value={modelData.model_name} />\n <IconButton\n aria-label=\"delete\"\n onClick={handeCustomDelete}\n disabled={customDeleted}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n )}\n {!is_custom && <TitleTypography value={modelData.model_name} />}\n <Stack\n spacing={1}\n direction=\"row\"\n useFlexGap\n flexWrap=\"wrap\"\n sx={{ marginLeft: 1 }}\n >\n {(() => {\n return modelData.model_lang.map((v) => {\n return (\n <Chip key={v} label={v} variant=\"outlined\" size=\"small\" />\n )\n })\n })()}\n {(() => {\n if (modelData.model_specs.some((spec) => isCached(spec))) {\n return <Chip label=\"Cached\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n {(() => {\n if (is_custom && customDeleted) {\n return <Chip label=\"Deleted\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n </Stack>\n {modelData.model_description && (\n <p style={styles.p} title={modelData.model_description}>\n {modelData.model_description}\n </p>\n )}\n\n <div style={styles.iconRow}>\n <div style={styles.iconItem}>\n <span style={styles.boldIconText}>\n {Math.floor(modelData.context_length / 1000)}K\n </span>\n <small style={styles.smallText}>context length</small>\n </div>\n {(() => {\n if (modelData.model_ability.includes('chat')) {\n return (\n <div style={styles.iconItem}>\n <ChatOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>chat model</small>\n </div>\n )\n } else if (modelData.model_ability.includes('generate')) {\n return (\n <div style={styles.iconItem}>\n <EditNoteOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>generate model</small>\n </div>\n )\n } else {\n return (\n <div style={styles.iconItem}>\n <HelpCenterOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>other model</small>\n </div>\n )\n }\n })()}\n </div>\n </Box>\n ) : (\n <Box style={styles.descriptionCard}>\n <div style={styles.titleContainer}>\n {is_custom && (\n <Stack direction=\"row\" spacing={1} useFlexGap>\n <TitleTypography value={modelData.model_name} />\n <IconButton\n aria-label=\"delete\"\n onClick={handeCustomDelete}\n disabled={customDeleted}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n )}\n {!is_custom && <TitleTypography value={modelData.model_name} />}\n <Stack\n spacing={1}\n direction=\"row\"\n useFlexGap\n flexWrap=\"wrap\"\n sx={{ marginLeft: 1 }}\n >\n {(() => {\n if (modelData.language) {\n return modelData.language.map((v) => {\n return <Chip label={v} variant=\"outlined\" size=\"small\" />\n })\n } else if (modelData.model_family) {\n return (\n <Chip\n label={modelData.model_family}\n variant=\"outlined\"\n size=\"small\"\n />\n )\n }\n })()}\n {(() => {\n if (modelData.cache_status) {\n return <Chip label=\"Cached\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n {(() => {\n if (is_custom && customDeleted) {\n return (\n <Chip label=\"Deleted\" variant=\"outlined\" size=\"small\" />\n )\n }\n })()}\n </Stack>\n </div>\n {modelData.dimensions && (\n <div style={styles.iconRow}>\n <div style={styles.iconItem}>\n <span style={styles.boldIconText}>{modelData.dimensions}</span>\n <small style={styles.smallText}>dimensions</small>\n </div>\n <div style={styles.iconItem}>\n <span style={styles.boldIconText}>{modelData.max_tokens}</span>\n <small style={styles.smallText}>max tokens</small>\n </div>\n </div>\n )}\n {!selected && hover && (\n <p style={styles.instructionText}>\n Click with mouse to launch the model\n </p>\n )}\n </Box>\n )}\n <Drawer\n open={selected}\n onClose={() => setSelected(false)}\n anchor={'right'}\n >\n <div style={styles.drawerCard}>\n <TitleTypography value={modelData.model_name} />\n {modelType === 'LLM' ? (\n <Box\n ref={parentRef}\n style={styles.formContainer}\n display=\"flex\"\n flexDirection=\"column\"\n width=\"100%\"\n mx=\"auto\"\n >\n <Grid rowSpacing={0} columnSpacing={1}>\n <Grid item xs={12}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <InputLabel id=\"modelFormat-label\">Model Format</InputLabel>\n <Select\n labelId=\"modelFormat-label\"\n value={modelFormat}\n onChange={(e) => setModelFormat(e.target.value)}\n label=\"Model Format\"\n >\n {formatOptions.map((format) => {\n const specs = modelData.model_specs.filter(\n (spec) => spec.model_format === format\n )\n\n const cached = specs.some((spec) => isCached(spec))\n const displayedFormat = cached\n ? format + ' (cached)'\n : format\n\n return (\n <MenuItem key={format} value={format}>\n {displayedFormat}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\n <Grid item xs={12}>\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat}\n >\n <InputLabel id=\"modelSize-label\">Model Size</InputLabel>\n <Select\n labelId=\"modelSize-label\"\n value={modelSize}\n onChange={(e) => setModelSize(e.target.value)}\n label=\"Model Size\"\n >\n {sizeOptions.map((size) => {\n const specs = modelData.model_specs\n .filter((spec) => spec.model_format === modelFormat)\n .filter(\n (spec) => spec.model_size_in_billions === size\n )\n const cached = specs.some((spec) => isCached(spec))\n const displayedSize = cached ? size + ' (cached)' : size\n\n return (\n <MenuItem key={size} value={size}>\n {displayedSize}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\n <Grid item xs={12}>\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat || !modelSize}\n >\n <InputLabel id=\"quantization-label\">\n Quantization\n </InputLabel>\n <Select\n labelId=\"quantization-label\"\n value={quantization}\n onChange={(e) => setQuantization(e.target.value)}\n label=\"Quantization\"\n >\n {quantizationOptions.map((quant, index) => {\n const specs = modelData.model_specs\n .filter((spec) => spec.model_format === modelFormat)\n .filter(\n (spec) =>\n spec.model_size_in_billions ===\n convertModelSize(modelSize)\n )\n\n const cached =\n modelFormat === 'pytorch'\n ? specs[0]?.cache_status ?? false === true\n : specs[0]?.cache_status?.[index] ?? false === true\n const displayedQuant = cached\n ? quant + ' (cached)'\n : quant\n\n return (\n <MenuItem key={quant} value={quant}>\n {displayedQuant}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\n <Grid item xs={12}>\n {modelFormat !== 'ggufv2' && modelFormat !== 'ggmlv3' ? (\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat || !modelSize || !quantization}\n >\n <InputLabel id=\"n-gpu-label\">N-GPU</InputLabel>\n <Select\n labelId=\"n-gpu-label\"\n value={nGPU}\n onChange={(e) => setNGPU(e.target.value)}\n label=\"N-GPU\"\n >\n {getNGPURange().map((v) => {\n return (\n <MenuItem key={v} value={v}>\n {v}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n ) : (\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n disabled={!modelFormat || !modelSize || !quantization}\n type=\"number\"\n label=\"N GPU Layers\"\n InputProps={{\n inputProps: {\n min: -1,\n },\n }}\n value={nGPULayers}\n onChange={(e) =>\n setNGPULayers(parseInt(e.target.value, 10))\n }\n />\n </FormControl>\n )}\n </Grid>\n <Grid item xs={12}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n disabled={!modelFormat || !modelSize || !quantization}\n type=\"number\"\n InputProps={{\n inputProps: {\n min: 1,\n },\n }}\n label=\"Replica\"\n value={replica}\n onChange={(e) => setReplica(parseInt(e.target.value, 10))}\n />\n </FormControl>\n </Grid>\n <ListItemButton onClick={() => setIsOther(!isOther)}>\n <ListItemText primary=\"Optional Configurations\" />\n {isOther ? <ExpandLess /> : <ExpandMore />}\n </ListItemButton>\n <Collapse in={isOther} timeout=\"auto\" unmountOnExit>\n <Grid item xs={12}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n variant=\"outlined\"\n value={modelUID}\n label=\"(Optional) Model UID, model name by default\"\n onChange={(e) => setModelUID(e.target.value)}\n />\n </FormControl>\n </Grid>\n <Grid item xs={12}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n value={requestLimits}\n label=\"(Optional) Request Limits, the number of request limits for this model,default is None\"\n onChange={(e) => {\n setRequestLimitsAlert(false)\n setRequestLimits(e.target.value)\n if (\n e.target.value !== '' &&\n (!Number(e.target.value) ||\n Number(e.target.value) < 1 ||\n parseInt(e.target.value) !==\n parseFloat(e.target.value))\n ) {\n setRequestLimitsAlert(true)\n }\n }}\n />\n {requestLimitsAlert && (\n <Alert severity=\"error\">\n Please enter an integer greater than 0\n </Alert>\n )}\n </FormControl>\n </Grid>\n <Grid item xs={12}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n variant=\"outlined\"\n value={workerIp}\n label=\"(Optional) Worker Ip, specify the worker ip where the model is located in a distributed scenario\"\n onChange={(e) => setWorkerIp(e.target.value)}\n />\n </FormControl>\n </Grid>\n <Grid item xs={12}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n value={GPUIdx}\n label=\"(Optional) GPU Idx, Specify the GPU index where the model is located\"\n onChange={(e) => {\n setGPUIdxAlert(false)\n setGPUIdx(e.target.value)\n const regular = /^\\d+(?:,\\d+)*$/\n if (\n e.target.value !== '' &&\n !regular.test(e.target.value)\n ) {\n setGPUIdxAlert(true)\n }\n }}\n />\n {GPUIdxAlert && (\n <Alert severity=\"error\">\n Please enter numeric data separated by commas, for\n example: 0,1,2\n </Alert>\n )}\n </FormControl>\n </Grid>\n <ListItemButton\n onClick={() => setIsPeftModelConfig(!isPeftModelConfig)}\n >\n <ListItemText primary=\"Lora Config\" />\n {isPeftModelConfig ? <ExpandLess /> : <ExpandMore />}\n </ListItemButton>\n <Collapse\n in={isPeftModelConfig}\n timeout=\"auto\"\n unmountOnExit\n style={{ marginLeft: '30px' }}\n >\n <AddPair\n customData={{\n title: 'Lora Model Config',\n key: 'lora_name',\n value: 'local_path',\n }}\n onGetArr={getLoraListArr}\n onJudgeArr={judgeArr}\n />\n <AddPair\n customData={{\n title: 'Lora Load Kwargs for Image Model',\n key: 'key',\n value: 'value',\n }}\n onGetArr={getImageLoraLoadKwargsArr}\n onJudgeArr={judgeArr}\n />\n <AddPair\n customData={{\n title: 'Lora Fuse Kwargs for Image Model',\n key: 'key',\n value: 'value',\n }}\n onGetArr={getImageLoraFuseKwargsArr}\n onJudgeArr={judgeArr}\n />\n </Collapse>\n </Collapse>\n <AddPair\n customData={{\n title:\n 'Additional parameters passed to the inference engine',\n key: 'key',\n value: 'value',\n }}\n onGetArr={getCustomParametersArr}\n onJudgeArr={judgeArr}\n />\n </Grid>\n </Box>\n ) : (\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n variant=\"outlined\"\n value={modelUID}\n label=\"(Optional) Model UID, model name by default\"\n onChange={(e) => setModelUID(e.target.value)}\n />\n {(modelType === 'embedding' || modelType === 'rerank') && (\n <TextField\n style={{ marginTop: '25px' }}\n type=\"number\"\n InputProps={{\n inputProps: {\n min: 1,\n },\n }}\n label=\"Replica\"\n value={replica}\n onChange={(e) => setReplica(parseInt(e.target.value, 10))}\n />\n )}\n </FormControl>\n )}\n <Box style={styles.buttonsContainer}>\n <button\n title=\"Launch\"\n style={styles.buttonContainer}\n onClick={() => launchModel(url, modelData)}\n disabled={\n modelType === 'LLM' &&\n (isCallingApi ||\n isUpdatingModel ||\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== 'pytorch'))\n ) ||\n !judgeArr(customParametersArr, ['key', 'value']) ||\n !judgeArr(loraListArr, ['lora_name', 'local_path']) ||\n !judgeArr(imageLoraLoadKwargsArr, ['key', 'value']) ||\n !judgeArr(imageLoraFuseKwargsArr, ['key', 'value']) ||\n requestLimitsAlert ||\n GPUIdxAlert)\n }\n >\n {(() => {\n if (isCallingApi || isUpdatingModel) {\n return (\n <Box\n style={{\n ...styles.buttonItem,\n backgroundColor: '#f2f2f2',\n }}\n >\n <CircularProgress\n size=\"20px\"\n sx={{\n color: '#000000',\n }}\n />\n </Box>\n )\n } else if (\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== 'pytorch'))\n )\n ) {\n return (\n <Box\n style={{\n ...styles.buttonItem,\n backgroundColor: '#f2f2f2',\n }}\n >\n <RocketLaunchOutlined size=\"20px\" />\n </Box>\n )\n } else {\n return (\n <Box style={styles.buttonItem}>\n <RocketLaunchOutlined color=\"#000000\" size=\"20px\" />\n </Box>\n )\n }\n })()}\n </button>\n <button\n title=\"Go Back\"\n style={styles.buttonContainer}\n onClick={() => setSelected(false)}\n >\n <Box style={styles.buttonItem}>\n <UndoOutlined color=\"#000000\" size=\"20px\" />\n </Box>\n </button>\n </Box>\n </div>\n </Drawer>\n <Snackbar\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n open={openSnackbar}\n onClose={() => setOpenSnackbar(false)}\n message=\"Please fill in the complete parameters before adding!!\"\n key={'top' + 'center'}\n />\n </Paper>\n )\n}\n\nexport default ModelCard\n"],"mappings":"8aAAA,OACEA,YAAY,CACZC,gBAAgB,CAChBC,UAAU,CACVC,UAAU,CACVC,kBAAkB,CAClBC,oBAAoB,CACpBC,YAAY,KACP,qBAAqB,CAC5B,MAAO,CAAAC,UAAU,KAAM,4BAA4B,CACnD,OACEC,KAAK,CACLC,GAAG,CACHC,IAAI,CACJC,gBAAgB,CAChBC,QAAQ,CACRC,MAAM,CACNC,WAAW,CACXC,IAAI,CACJC,UAAU,CACVC,UAAU,CACVC,cAAc,CACdC,YAAY,CACZC,QAAQ,CACRC,MAAM,CACNC,QAAQ,CACRC,KAAK,CACLC,SAAS,KACJ,eAAe,CACtB,MAAO,CAAAC,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CACtE,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,eAAe,KAAM,kCAAkC,CAC9D,MAAO,CAAAC,OAAO,KAAM,sBAAsB,CAC1C,MAAO,CAAAC,MAAM,KAAM,yBAAyB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAE5C,GAAM,CAAAC,SAAS,CAAG,QAAZ,CAAAA,SAASA,CAAAC,IAAA,CAMT,IALJ,CAAAC,GAAG,CAAAD,IAAA,CAAHC,GAAG,CACHC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,YAAY,CAAAH,IAAA,CAAZG,YAAY,CACZC,SAAS,CAAAJ,IA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,GAAG,EAACuP,KAAK,CAAE5N,MAAM,CAACoT,UAAW,CAAAjF,QAAA,cAC5BjO,IAAA,CAAChC,YAAY,EAACoV,KAAK,CAAC,SAAS,CAAC3K,IAAI,CAAC,MAAM,CAAE,CAAC,CACzC,CAAC,CACA,CAAC,EACN,CAAC,EACH,CAAC,CACA,CAAC,cACTzI,IAAA,CAAChB,QAAQ,EACPqU,YAAY,CAAE,CAAEC,QAAQ,CAAE,KAAK,CAAEC,UAAU,CAAE,QAAS,CAAE,CACxDvD,IAAI,CAAE1N,YAAa,CACnB2N,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAA1N,eAAe,CAAC,KAAK,CAAC,EAAC,CACtCiR,OAAO,CAAC,wDAAwD,EAC3D,KAAK,CAAG,QACd,CAAC,EACG,CAAC,CAEZ,CAAC,CAED,cAAe,CAAArT,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ast":null,"code":"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 _objectWithoutProperties from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js\";var _excluded=[\"label\",\"value\",\"onChange\",\"hotkey\"];import{TextField}from'@mui/material';import InputAdornment from'@mui/material/InputAdornment';import Typography from'@mui/material/Typography';import React,{useEffect,useRef,useState}from'react';import{jsxs as _jsxs}from\"react/jsx-runtime\";import{jsx as _jsx}from\"react/jsx-runtime\";var HotkeyFocusTextField=function HotkeyFocusTextField(_ref){var label=_ref.label,value=_ref.value,onChange=_ref.onChange,_ref$hotkey=_ref.hotkey,hotkey=_ref$hotkey===void 0?'/':_ref$hotkey,props=_objectWithoutProperties(_ref,_excluded);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isFocused=_useState2[0],setIsFocused=_useState2[1];var textFieldRef=useRef(null);var handleKeyDown=function handleKeyDown(event){if(event.key===hotkey&&document.activeElement!==textFieldRef.current){var _textFieldRef$current;event.preventDefault();setIsFocused(true);(_textFieldRef$current=textFieldRef.current)===null||_textFieldRef$current===void 0?void 0:_textFieldRef$current.focus();}};useEffect(function(){document.addEventListener('keydown',handleKeyDown);return function(){document.removeEventListener('keydown',handleKeyDown);};},[hotkey]);return/*#__PURE__*/_jsx(TextField,_objectSpread(_objectSpread({},props),{},{label:label,value:value,onChange:onChange,inputRef:textFieldRef,autoFocus:isFocused,onBlur:function onBlur(){return setIsFocused(false);},onFocus:function onFocus(){return setIsFocused(true);},InputProps:{endAdornment:!isFocused&&!value?/*#__PURE__*/_jsx(InputAdornment,{position:\"end\",children:/*#__PURE__*/_jsxs(Typography,{color:\"textSecondary\",style:{fontSize:'inherit'},children:[\"Type \",hotkey,\" to search\"]})}):null}}));};export default HotkeyFocusTextField;","map":{"version":3,"names":["TextField","InputAdornment","Typography","React","useEffect","useRef","useState","jsxs","_jsxs","jsx","_jsx","HotkeyFocusTextField","_ref","label","value","onChange","_ref$hotkey","hotkey","props","_objectWithoutProperties","_excluded","_useState","_useState2","_slicedToArray","isFocused","setIsFocused","textFieldRef","handleKeyDown","event","key","document","activeElement","current","_textFieldRef$current","preventDefault","focus","addEventListener","removeEventListener","_objectSpread","inputRef","autoFocus","onBlur","onFocus","InputProps","endAdornment","position","children","color","style","fontSize"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/hotkeyFocusTextField.js"],"sourcesContent":["import { TextField } from '@mui/material'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Typography from '@mui/material/Typography'\nimport React, { useEffect, useRef, useState } from 'react'\n\nconst HotkeyFocusTextField = ({\n label,\n value,\n onChange,\n hotkey = '/',\n ...props\n}) => {\n const [isFocused, setIsFocused] = useState(false)\n const textFieldRef = useRef(null)\n const handleKeyDown = (event) => {\n if (\n event.key === hotkey &&\n document.activeElement !== textFieldRef.current\n ) {\n event.preventDefault()\n setIsFocused(true)\n textFieldRef.current?.focus()\n }\n }\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [hotkey])\n\n return (\n <TextField\n {...props}\n label={label}\n value={value}\n onChange={onChange}\n inputRef={textFieldRef}\n autoFocus={isFocused}\n onBlur={() => setIsFocused(false)}\n onFocus={() => setIsFocused(true)}\n InputProps={{\n endAdornment:\n !isFocused && !value ? (\n <InputAdornment position=\"end\">\n <Typography color=\"textSecondary\" style={{ fontSize: 'inherit' }}>\n Type {hotkey} to search\n </Typography>\n </InputAdornment>\n ) : null,\n }}\n />\n )\n}\n\nexport default HotkeyFocusTextField\n"],"mappings":"8eAAA,OAASA,SAAS,KAAQ,eAAe,CACzC,MAAO,CAAAC,cAAc,KAAM,8BAA8B,CACzD,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,QAAAC,IAAA,IAAAC,KAAA,gCAAAC,GAAA,IAAAC,IAAA,yBAE1D,GAAM,CAAAC,oBAAoB,CAAG,QAAvB,CAAAA,oBAAoBA,CAAAC,IAAA,CAMpB,IALJ,CAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CAAAC,WAAA,CAAAJ,IAAA,CACRK,MAAM,CAANA,MAAM,CAAAD,WAAA,UAAG,GAAG,CAAAA,WAAA,CACTE,KAAK,CAAAC,wBAAA,CAAAP,IAAA,CAAAQ,SAAA,EAER,IAAAC,SAAA,CAAkCf,QAAQ,CAAC,KAAK,CAAC,CAAAgB,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAA1CG,SAAS,CAAAF,UAAA,IAAEG,YAAY,CAAAH,UAAA,IAC9B,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,CAAE,SAAU,CAAE,CAAAH,QAAA,EAAC,OAC3D,CAAC7B,MAAM,CAAC,YACf,EAAY,CAAC,CACC,CAAC,CACf,IACR,CAAE,EACH,CAAC,CAEN,CAAC,CAED,cAAe,CAAAN,oBAAoB"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xinference
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.2.post1
|
|
4
4
|
Summary: Model Serving Made Easy
|
|
5
5
|
Home-page: https://github.com/xorbitsai/inference
|
|
6
6
|
Author: Qin Xuye
|
|
@@ -67,6 +67,7 @@ Requires-Dist: outlines ==0.0.34 ; extra == 'all'
|
|
|
67
67
|
Requires-Dist: attrdict ; extra == 'all'
|
|
68
68
|
Requires-Dist: timm >=0.9.16 ; extra == 'all'
|
|
69
69
|
Requires-Dist: torchvision ; extra == 'all'
|
|
70
|
+
Requires-Dist: FlagEmbedding ; extra == 'all'
|
|
70
71
|
Requires-Dist: auto-gptq ; (sys_platform != "darwin") and extra == 'all'
|
|
71
72
|
Requires-Dist: autoawq ; (sys_platform != "darwin") and extra == 'all'
|
|
72
73
|
Requires-Dist: vllm >=0.2.6 ; (sys_platform == "linux") and extra == 'all'
|
|
@@ -115,6 +116,8 @@ Requires-Dist: controlnet-aux ; extra == 'image'
|
|
|
115
116
|
Provides-Extra: intel
|
|
116
117
|
Requires-Dist: torch ==2.1.0a0 ; extra == 'intel'
|
|
117
118
|
Requires-Dist: intel-extension-for-pytorch ==2.1.10+xpu ; extra == 'intel'
|
|
119
|
+
Provides-Extra: rerank
|
|
120
|
+
Requires-Dist: FlagEmbedding ; extra == 'rerank'
|
|
118
121
|
Provides-Extra: sglang
|
|
119
122
|
Requires-Dist: sglang[all] ; extra == 'sglang'
|
|
120
123
|
Provides-Extra: transformers
|