xinference 1.5.1__py3-none-any.whl → 1.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xinference might be problematic. Click here for more details.
- xinference/_version.py +3 -3
- xinference/api/restful_api.py +97 -8
- xinference/client/restful/restful_client.py +51 -11
- xinference/core/media_interface.py +758 -0
- xinference/core/model.py +49 -9
- xinference/core/worker.py +31 -37
- xinference/deploy/utils.py +0 -3
- xinference/model/audio/__init__.py +16 -27
- xinference/model/audio/core.py +1 -0
- xinference/model/audio/cosyvoice.py +4 -2
- xinference/model/audio/model_spec.json +20 -3
- xinference/model/audio/model_spec_modelscope.json +18 -1
- xinference/model/embedding/__init__.py +16 -24
- xinference/model/image/__init__.py +15 -25
- xinference/model/llm/__init__.py +37 -110
- xinference/model/llm/core.py +15 -6
- xinference/model/llm/llama_cpp/core.py +25 -353
- xinference/model/llm/llm_family.json +613 -89
- xinference/model/llm/llm_family.py +9 -1
- xinference/model/llm/llm_family_modelscope.json +540 -90
- xinference/model/llm/mlx/core.py +6 -3
- xinference/model/llm/reasoning_parser.py +281 -5
- xinference/model/llm/sglang/core.py +16 -3
- xinference/model/llm/transformers/chatglm.py +2 -2
- xinference/model/llm/transformers/cogagent.py +1 -1
- xinference/model/llm/transformers/cogvlm2.py +1 -1
- xinference/model/llm/transformers/core.py +9 -3
- xinference/model/llm/transformers/glm4v.py +1 -1
- xinference/model/llm/transformers/minicpmv26.py +1 -1
- xinference/model/llm/transformers/qwen-omni.py +6 -0
- xinference/model/llm/transformers/qwen_vl.py +1 -1
- xinference/model/llm/utils.py +68 -45
- xinference/model/llm/vllm/core.py +38 -18
- xinference/model/llm/vllm/xavier/test/test_xavier.py +1 -10
- xinference/model/rerank/__init__.py +13 -24
- xinference/model/video/__init__.py +15 -25
- xinference/model/video/core.py +3 -3
- xinference/model/video/diffusers.py +133 -16
- xinference/model/video/model_spec.json +54 -0
- xinference/model/video/model_spec_modelscope.json +56 -0
- xinference/thirdparty/cosyvoice/bin/average_model.py +5 -4
- xinference/thirdparty/cosyvoice/bin/export_jit.py +50 -20
- xinference/thirdparty/cosyvoice/bin/export_onnx.py +136 -51
- xinference/thirdparty/cosyvoice/bin/inference.py +15 -5
- xinference/thirdparty/cosyvoice/bin/train.py +7 -2
- xinference/thirdparty/cosyvoice/cli/cosyvoice.py +72 -52
- xinference/thirdparty/cosyvoice/cli/frontend.py +58 -58
- xinference/thirdparty/cosyvoice/cli/model.py +140 -155
- xinference/thirdparty/cosyvoice/dataset/processor.py +9 -5
- xinference/thirdparty/cosyvoice/flow/decoder.py +656 -54
- xinference/thirdparty/cosyvoice/flow/flow.py +69 -11
- xinference/thirdparty/cosyvoice/flow/flow_matching.py +167 -63
- xinference/thirdparty/cosyvoice/flow/length_regulator.py +1 -0
- xinference/thirdparty/cosyvoice/hifigan/discriminator.py +91 -1
- xinference/thirdparty/cosyvoice/hifigan/f0_predictor.py +4 -1
- xinference/thirdparty/cosyvoice/hifigan/generator.py +4 -1
- xinference/thirdparty/cosyvoice/hifigan/hifigan.py +2 -2
- xinference/thirdparty/cosyvoice/llm/llm.py +198 -18
- xinference/thirdparty/cosyvoice/transformer/embedding.py +12 -4
- xinference/thirdparty/cosyvoice/transformer/upsample_encoder.py +124 -21
- xinference/thirdparty/cosyvoice/utils/class_utils.py +13 -0
- xinference/thirdparty/cosyvoice/utils/common.py +1 -1
- xinference/thirdparty/cosyvoice/utils/file_utils.py +40 -2
- xinference/thirdparty/cosyvoice/utils/frontend_utils.py +7 -0
- xinference/thirdparty/cosyvoice/utils/mask.py +4 -0
- xinference/thirdparty/cosyvoice/utils/train_utils.py +5 -1
- xinference/thirdparty/matcha/hifigan/xutils.py +3 -3
- xinference/types.py +0 -71
- xinference/web/ui/build/asset-manifest.json +3 -3
- xinference/web/ui/build/index.html +1 -1
- xinference/web/ui/build/static/js/main.ae579a97.js +3 -0
- xinference/web/ui/build/static/js/main.ae579a97.js.map +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/0196a4b09e3264614e54360d5f832c46b31d964ec58296765ebff191ace6adbf.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/12e02ee790dbf57ead09a241a93bb5f893393aa36628ca741d44390e836a103f.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/18fa271456b31cded36c05c4c71c6b2b1cf4e4128c1e32f0e45d8b9f21764397.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/2fdc61dcb6a9d1fbcb44be592d0e87d8c3f21297a7327559ef5345665f8343f7.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/3d596a3e8dd6430d7ce81d164e32c31f8d47cfa5f725c328a298754d78563e14.json +1 -0
- xinference/web/ui/node_modules/.cache/babel-loader/8472e58a31720892d534f3febda31f746b25ec4aa60787eef34217b074e67965.json +1 -0
- xinference/web/ui/src/locales/en.json +6 -4
- xinference/web/ui/src/locales/zh.json +6 -4
- {xinference-1.5.1.dist-info → xinference-1.6.0.dist-info}/METADATA +56 -36
- {xinference-1.5.1.dist-info → xinference-1.6.0.dist-info}/RECORD +87 -87
- {xinference-1.5.1.dist-info → xinference-1.6.0.dist-info}/WHEEL +1 -1
- xinference/core/image_interface.py +0 -377
- xinference/thirdparty/cosyvoice/bin/export_trt.sh +0 -9
- xinference/web/ui/build/static/js/main.91e77b5c.js +0 -3
- xinference/web/ui/build/static/js/main.91e77b5c.js.map +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/0f0adb2283a8f469d097a7a0ebb754624fa52414c83b83696c41f2e6a737ceda.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/5e6edb0fb87e3798f142e9abf8dd2dc46bab33a60d31dff525797c0c99887097.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/6087820be1bd5c02c42dff797e7df365448ef35ab26dd5d6bd33e967e05cbfd4.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/8157db83995c671eb57abc316c337f867d1dc63fb83520bb4ff351fee57dcce2.json +0 -1
- xinference/web/ui/node_modules/.cache/babel-loader/f04f666b77b44d7be3e16034d6b0074de2ba9c254f1fae15222b3148608fa8b3.json +0 -1
- /xinference/web/ui/build/static/js/{main.91e77b5c.js.LICENSE.txt → main.ae579a97.js.LICENSE.txt} +0 -0
- {xinference-1.5.1.dist-info → xinference-1.6.0.dist-info}/entry_points.txt +0 -0
- {xinference-1.5.1.dist-info → xinference-1.6.0.dist-info}/licenses/LICENSE +0 -0
- {xinference-1.5.1.dist-info → xinference-1.6.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Button,ButtonGroup,Chip,FormControl,InputLabel,MenuItem,Select}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useTranslation}from'react-i18next';import{ApiContext}from'../../components/apiContext';import fetchWrapper from'../../components/fetchWrapper';import HotkeyFocusTextField from'../../components/hotkeyFocusTextField';import ModelCard from'./modelCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var modelAbilityArr=['generate','chat','vision','reasoning'];var audioModelTypeArr=['audio-to-text','text-to-audio','audio-to-audio'];var LaunchModelComponent=function LaunchModelComponent(_ref){var modelType=_ref.modelType,gpuAvailable=_ref.gpuAvailable,featureModels=_ref.featureModels;var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi,endPoint=_useContext.endPoint;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var _useState=useState([]),_useState2=_slicedToArray(_useState,2),registrationData=_useState2[0],setRegistrationData=_useState2[1];// States used for filtering\nvar _useState3=useState(''),_useState4=_slicedToArray(_useState3,2),searchTerm=_useState4[0],setSearchTerm=_useState4[1];var _useState5=useState(''),_useState6=_slicedToArray(_useState5,2),LLMModelAbility=_useState6[0],setLLMModelAbility=_useState6[1];var _useState7=useState(''),_useState8=_slicedToArray(_useState7,2),status=_useState8[0],setStatus=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),statusArr=_useState10[0],setStatusArr=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),completeDeleteArr=_useState12[0],setCompleteDeleteArr=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),collectionArr=_useState14[0],setCollectionArr=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),filterArr=_useState16[0],setFilterArr=_useState16[1];var _useTranslation=useTranslation(),t=_useTranslation.t;var _useState17=useState('featured'),_useState18=_slicedToArray(_useState17,2),modelListType=_useState18[0],setModelListType=_useState18[1];var _useState19=useState(''),_useState20=_slicedToArray(_useState19,2),audioModelAbility=_useState20[0],setAudioModelAbility=_useState20[1];var filter=function filter(registration){if(searchTerm!==''){if(!registration||typeof searchTerm!=='string')return false;var modelName=registration.model_name?registration.model_name.toLowerCase():'';var modelDescription=registration.model_description?registration.model_description.toLowerCase():'';if(!modelName.includes(searchTerm.toLowerCase())&&!modelDescription.includes(searchTerm.toLowerCase())){return false;}}if(modelListType==='featured'){if(featureModels.length&&!featureModels.includes(registration.model_name)){return false;}}if(LLMModelAbility&&(Array.isArray(registration.model_ability)&®istration.model_ability.indexOf(LLMModelAbility)<0||typeof registration.model_ability==='string'&®istration.model_ability!==LLMModelAbility))return false;if(audioModelAbility&&(Array.isArray(registration.model_ability)&®istration.model_ability.indexOf(audioModelAbility)<0||typeof registration.model_ability==='string'&®istration.model_ability!==audioModelAbility))return false;if(completeDeleteArr.includes(registration.model_name)){registration.model_specs.forEach(function(item){item.cache_status=Array.isArray(item)?[false]:false;});}if(statusArr.length===1){if(statusArr[0]==='cached'){var _registration$model_s;var judge=((_registration$model_s=registration.model_specs)===null||_registration$model_s===void 0?void 0:_registration$model_s.some(function(spec){return filterCache(spec);}))||(registration===null||registration===void 0?void 0:registration.cache_status);return judge&&!completeDeleteArr.includes(registration.model_name);}else{return collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name);}}else if(statusArr.length>1){var _registration$model_s2;var _judge=((_registration$model_s2=registration.model_specs)===null||_registration$model_s2===void 0?void 0:_registration$model_s2.some(function(spec){return filterCache(spec);}))||(registration===null||registration===void 0?void 0:registration.cache_status);return _judge&&!completeDeleteArr.includes(registration.model_name)&&(collectionArr===null||collectionArr===void 0?void 0:collectionArr.includes(registration.model_name));}return true;};var filterCache=function filterCache(spec){if(Array.isArray(spec.cache_status)){var _spec$cache_status;return(_spec$cache_status=spec.cache_status)===null||_spec$cache_status===void 0?void 0:_spec$cache_status.some(function(cs){return cs;});}else{return spec.cache_status===true;}};var handleCompleteDelete=function handleCompleteDelete(model_name){setCompleteDeleteArr([].concat(_toConsumableArray(completeDeleteArr),[model_name]));};var update=function update(){if(isCallingApi||isUpdatingModel||cookie.token!=='no_auth'&&!sessionStorage.getItem('token'))return;try{setIsCallingApi(true);fetchWrapper.get(\"/v1/model_registrations/\".concat(modelType,\"?detailed=true\")).then(function(data){var builtinRegistrations=data.filter(function(v){return v.is_builtin;});setRegistrationData(builtinRegistrations);var collectionData=JSON.parse(localStorage.getItem('collectionArr'));setCollectionArr(collectionData);}).catch(function(error){console.error('Error:',error);if(error.response.status!==403&&error.response.status!==401){setErrorMsg(error.message);}});}catch(error){console.error('Error:',error);}finally{setIsCallingApi(false);}};useEffect(function(){update();},[cookie.token]);var getCollectionArr=function getCollectionArr(data){setCollectionArr(data);};var handleChangeFilter=function handleChangeFilter(type,value){var typeMap={LLMModelAbility:{setter:setLLMModelAbility,filterArr:modelAbilityArr},audioModelAbility:{setter:setAudioModelAbility,filterArr:audioModelTypeArr},status:{setter:setStatus,filterArr:[]}};var _ref2=typeMap[type]||{},setter=_ref2.setter,excludeArr=_ref2.filterArr;if(!setter)return;setter(value);var updatedFilterArr=[].concat(_toConsumableArray(filterArr.filter(function(item){return!excludeArr.includes(item);})),[value]);setFilterArr(updatedFilterArr);if(type==='status'){setStatusArr(updatedFilterArr.filter(function(item){return![].concat(modelAbilityArr,audioModelTypeArr).includes(item);}));}};var handleDeleteChip=function handleDeleteChip(item){setFilterArr(filterArr.filter(function(subItem){return subItem!==item;}));if(item===LLMModelAbility){setLLMModelAbility('');}else if(item===audioModelAbility){setAudioModelAbility('');}else{setStatusArr(statusArr.filter(function(subItem){return subItem!==item;}));if(item===status)setStatus('');}};var handleModelType=function handleModelType(newModelType){if(newModelType!==null){setModelListType(newModelType);}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:'grid',gridTemplateColumns:function(){var baseColumns=['LLM','audio'].includes(modelType)?['150px','150px']:['150px'];return featureModels.length?[].concat(baseColumns,['150px','1fr']).join(' '):[].concat(baseColumns,['1fr']).join(' ');}(),columnGap:'20px',margin:'30px 2rem',alignItems:'center'},children:[featureModels.length>0&&/*#__PURE__*/_jsx(FormControl,{sx:{minWidth:120},size:\"small\",children:/*#__PURE__*/_jsxs(ButtonGroup,{children:[/*#__PURE__*/_jsx(Button,{fullWidth:true,onClick:function onClick(){return handleModelType('featured');},variant:modelListType==='featured'?'contained':'outlined',children:t('launchModel.featured')}),/*#__PURE__*/_jsx(Button,{fullWidth:true,onClick:function onClick(){return handleModelType('all');},variant:modelListType==='all'?'contained':'outlined',children:t('launchModel.all')})]})}),modelType==='LLM'&&/*#__PURE__*/_jsxs(FormControl,{sx:{minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"ability-select-label\",children:t('launchModel.modelAbility')}),/*#__PURE__*/_jsx(Select,{id:\"ability\",labelId:\"ability-select-label\",label:\"Model Ability\",onChange:function onChange(e){return handleChangeFilter('LLMModelAbility',e.target.value);},value:LLMModelAbility,size:\"small\",sx:{width:'150px'},children:modelAbilityArr.map(function(item){return/*#__PURE__*/_jsx(MenuItem,{value:item,children:t(\"launchModel.\".concat(item))},item);})})]}),modelType==='audio'&&/*#__PURE__*/_jsxs(FormControl,{sx:{minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"ability-select-label\",children:t('launchModel.modelAbility')}),/*#__PURE__*/_jsx(Select,{id:\"ability\",labelId:\"ability-select-label\",label:\"Model Ability\",onChange:function onChange(e){return handleChangeFilter('audioModelAbility',e.target.value);},value:audioModelAbility,size:\"small\",sx:{width:'150px'},children:audioModelTypeArr.map(function(item){return/*#__PURE__*/_jsx(MenuItem,{value:item,children:item},item);})})]}),/*#__PURE__*/_jsxs(FormControl,{sx:{minWidth:120},size:\"small\",children:[/*#__PURE__*/_jsx(InputLabel,{id:\"select-status\",children:t('launchModel.status')}),/*#__PURE__*/_jsxs(Select,{id:\"status\",labelId:\"select-status\",label:t('launchModel.status'),onChange:function onChange(e){return handleChangeFilter('status',e.target.value);},value:status,size:\"small\",sx:{width:'150px'},children:[/*#__PURE__*/_jsx(MenuItem,{value:\"cached\",children:t('launchModel.cached')}),/*#__PURE__*/_jsx(MenuItem,{value:\"favorite\",children:t('launchModel.favorite')})]})]}),/*#__PURE__*/_jsx(FormControl,{sx:{marginTop:1},variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(HotkeyFocusTextField,{id:\"search\",type:\"search\",label:t('launchModel.search'),value:searchTerm,onChange:function onChange(e){return setSearchTerm(e.target.value);},size:\"small\",hotkey:\"Enter\",t:t})})]}),/*#__PURE__*/_jsx(\"div\",{style:{margin:'0 0 30px 30px'},children:filterArr.map(function(item,index){return/*#__PURE__*/_jsx(Chip,{label:t(\"launchModel.\".concat(item)),variant:\"outlined\",size:\"small\",color:\"primary\",style:{marginRight:10},onDelete:function onDelete(){return handleDeleteChip(item);}},index);})}),/*#__PURE__*/_jsx(\"div\",{style:{display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',gridGap:'2rem 0rem'},children:registrationData.filter(function(registration){return filter(registration);}).sort(function(a,b){if(modelListType==='featured'){var indexA=featureModels.indexOf(a.model_name);var indexB=featureModels.indexOf(b.model_name);return(indexA!==-1?indexA:Infinity)-(indexB!==-1?indexB:Infinity);}return 0;}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable,modelType:modelType,onHandleCompleteDelete:handleCompleteDelete,onGetCollectionArr:getCollectionArr},filteredRegistration.model_name);})})]});};export default LaunchModelComponent;","map":{"version":3,"names":["Box","Button","ButtonGroup","Chip","FormControl","InputLabel","MenuItem","Select","React","useContext","useEffect","useState","useCookies","useTranslation","ApiContext","fetchWrapper","HotkeyFocusTextField","ModelCard","jsx","_jsx","jsxs","_jsxs","modelAbilityArr","audioModelTypeArr","LaunchModelComponent","_ref","modelType","gpuAvailable","featureModels","_useContext","isCallingApi","setIsCallingApi","endPoint","_useContext2","isUpdatingModel","_useContext3","setErrorMsg","_useCookies","_useCookies2","_slicedToArray","cookie","_useState","_useState2","registrationData","setRegistrationData","_useState3","_useState4","searchTerm","setSearchTerm","_useState5","_useState6","LLMModelAbility","setLLMModelAbility","_useState7","_useState8","status","setStatus","_useState9","_useState10","statusArr","setStatusArr","_useState11","_useState12","completeDeleteArr","setCompleteDeleteArr","_useState13","_useState14","collectionArr","setCollectionArr","_useState15","_useState16","filterArr","setFilterArr","_useTranslation","t","_useState17","_useState18","modelListType","setModelListType","_useState19","_useState20","audioModelAbility","setAudioModelAbility","filter","registration","modelName","model_name","toLowerCase","modelDescription","model_description","includes","length","Array","isArray","model_ability","indexOf","model_specs","forEach","item","cache_status","_registration$model_s","judge","some","spec","filterCache","_registration$model_s2","_spec$cache_status","cs","handleCompleteDelete","concat","_toConsumableArray","update","token","sessionStorage","getItem","get","then","data","builtinRegistrations","v","is_builtin","collectionData","JSON","parse","localStorage","catch","error","console","response","message","getCollectionArr","handleChangeFilter","type","value","typeMap","setter","_ref2","excludeArr","updatedFilterArr","handleDeleteChip","subItem","handleModelType","newModelType","m","children","style","display","gridTemplateColumns","baseColumns","join","columnGap","margin","alignItems","sx","minWidth","size","fullWidth","onClick","variant","id","labelId","label","onChange","e","target","width","map","marginTop","hotkey","index","color","marginRight","onDelete","paddingLeft","gridGap","sort","a","b","indexA","indexB","Infinity","filteredRegistration","url","modelData","onHandleCompleteDelete","onGetCollectionArr"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/LaunchModel.js"],"sourcesContent":["import {\n Box,\n Button,\n ButtonGroup,\n Chip,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n} from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useTranslation } from 'react-i18next'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetchWrapper from '../../components/fetchWrapper'\nimport HotkeyFocusTextField from '../../components/hotkeyFocusTextField'\nimport ModelCard from './modelCard'\n\nconst modelAbilityArr = ['generate', 'chat', 'vision', 'reasoning']\nconst audioModelTypeArr = ['audio-to-text', 'text-to-audio', 'audio-to-audio']\n\nconst LaunchModelComponent = ({ modelType, gpuAvailable, featureModels }) => {\n const { isCallingApi, setIsCallingApi, endPoint } = 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 [LLMModelAbility, setLLMModelAbility] = useState('')\n const [status, setStatus] = useState('')\n const [statusArr, setStatusArr] = useState([])\n const [completeDeleteArr, setCompleteDeleteArr] = useState([])\n const [collectionArr, setCollectionArr] = useState([])\n const [filterArr, setFilterArr] = useState([])\n const { t } = useTranslation()\n const [modelListType, setModelListType] = useState('featured')\n const [audioModelAbility, setAudioModelAbility] = useState('')\n\n const filter = (registration) => {\n if (searchTerm !== '') {\n if (!registration || typeof searchTerm !== 'string') return false\n const modelName = registration.model_name\n ? registration.model_name.toLowerCase()\n : ''\n const modelDescription = registration.model_description\n ? registration.model_description.toLowerCase()\n : ''\n\n if (\n !modelName.includes(searchTerm.toLowerCase()) &&\n !modelDescription.includes(searchTerm.toLowerCase())\n ) {\n return false\n }\n }\n\n if (modelListType === 'featured') {\n if (\n featureModels.length &&\n !featureModels.includes(registration.model_name)\n ) {\n return false\n }\n }\n\n if (\n LLMModelAbility &&\n ((Array.isArray(registration.model_ability) &&\n registration.model_ability.indexOf(LLMModelAbility) < 0) ||\n (typeof registration.model_ability === 'string' &&\n registration.model_ability !== LLMModelAbility))\n )\n return false\n\n if (\n audioModelAbility &&\n ((Array.isArray(registration.model_ability) &&\n registration.model_ability.indexOf(audioModelAbility) < 0) ||\n (typeof registration.model_ability === 'string' &&\n registration.model_ability !== audioModelAbility))\n )\n return false\n\n if (completeDeleteArr.includes(registration.model_name)) {\n registration.model_specs.forEach((item) => {\n item.cache_status = Array.isArray(item) ? [false] : false\n })\n }\n\n if (statusArr.length === 1) {\n if (statusArr[0] === 'cached') {\n const judge =\n registration.model_specs?.some((spec) => filterCache(spec)) ||\n registration?.cache_status\n return judge && !completeDeleteArr.includes(registration.model_name)\n } else {\n return collectionArr?.includes(registration.model_name)\n }\n } else if (statusArr.length > 1) {\n const judge =\n registration.model_specs?.some((spec) => filterCache(spec)) ||\n registration?.cache_status\n return (\n judge &&\n !completeDeleteArr.includes(registration.model_name) &&\n collectionArr?.includes(registration.model_name)\n )\n }\n\n return true\n }\n\n const filterCache = (spec) => {\n if (Array.isArray(spec.cache_status)) {\n return spec.cache_status?.some((cs) => cs)\n } else {\n return spec.cache_status === true\n }\n }\n\n const handleCompleteDelete = (model_name) => {\n setCompleteDeleteArr([...completeDeleteArr, model_name])\n }\n\n const update = () => {\n if (\n isCallingApi ||\n isUpdatingModel ||\n (cookie.token !== 'no_auth' && !sessionStorage.getItem('token'))\n )\n return\n\n try {\n setIsCallingApi(true)\n\n fetchWrapper\n .get(`/v1/model_registrations/${modelType}?detailed=true`)\n .then((data) => {\n const builtinRegistrations = data.filter((v) => v.is_builtin)\n setRegistrationData(builtinRegistrations)\n const collectionData = JSON.parse(\n localStorage.getItem('collectionArr')\n )\n setCollectionArr(collectionData)\n })\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status !== 403 && error.response.status !== 401) {\n setErrorMsg(error.message)\n }\n })\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [cookie.token])\n\n const getCollectionArr = (data) => {\n setCollectionArr(data)\n }\n\n const handleChangeFilter = (type, value) => {\n const typeMap = {\n LLMModelAbility: {\n setter: setLLMModelAbility,\n filterArr: modelAbilityArr,\n },\n audioModelAbility: {\n setter: setAudioModelAbility,\n filterArr: audioModelTypeArr,\n },\n status: { setter: setStatus, filterArr: [] },\n }\n\n const { setter, filterArr: excludeArr } = typeMap[type] || {}\n if (!setter) return\n\n setter(value)\n\n const updatedFilterArr = [\n ...filterArr.filter((item) => !excludeArr.includes(item)),\n value,\n ]\n\n setFilterArr(updatedFilterArr)\n\n if (type === 'status') {\n setStatusArr(\n updatedFilterArr.filter(\n (item) => ![...modelAbilityArr, ...audioModelTypeArr].includes(item)\n )\n )\n }\n }\n\n const handleDeleteChip = (item) => {\n setFilterArr(\n filterArr.filter((subItem) => {\n return subItem !== item\n })\n )\n if (item === LLMModelAbility) {\n setLLMModelAbility('')\n } else if (item === audioModelAbility) {\n setAudioModelAbility('')\n } else {\n setStatusArr(\n statusArr.filter((subItem) => {\n return subItem !== item\n })\n )\n if (item === status) setStatus('')\n }\n }\n\n const handleModelType = (newModelType) => {\n if (newModelType !== null) {\n setModelListType(newModelType)\n }\n }\n\n return (\n <Box m=\"20px\">\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: (() => {\n const baseColumns = ['LLM', 'audio'].includes(modelType)\n ? ['150px', '150px']\n : ['150px']\n return featureModels.length\n ? [...baseColumns, '150px', '1fr'].join(' ')\n : [...baseColumns, '1fr'].join(' ')\n })(),\n columnGap: '20px',\n margin: '30px 2rem',\n alignItems: 'center',\n }}\n >\n {featureModels.length > 0 && (\n <FormControl sx={{ minWidth: 120 }} size=\"small\">\n <ButtonGroup>\n <Button\n fullWidth\n onClick={() => handleModelType('featured')}\n variant={\n modelListType === 'featured' ? 'contained' : 'outlined'\n }\n >\n {t('launchModel.featured')}\n </Button>\n <Button\n fullWidth\n onClick={() => handleModelType('all')}\n variant={modelListType === 'all' ? 'contained' : 'outlined'}\n >\n {t('launchModel.all')}\n </Button>\n </ButtonGroup>\n </FormControl>\n )}\n {modelType === 'LLM' && (\n <FormControl sx={{ minWidth: 120 }} size=\"small\">\n <InputLabel id=\"ability-select-label\">\n {t('launchModel.modelAbility')}\n </InputLabel>\n <Select\n id=\"ability\"\n labelId=\"ability-select-label\"\n label=\"Model Ability\"\n onChange={(e) =>\n handleChangeFilter('LLMModelAbility', e.target.value)\n }\n value={LLMModelAbility}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n {modelAbilityArr.map((item) => (\n <MenuItem key={item} value={item}>\n {t(`launchModel.${item}`)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )}\n {modelType === 'audio' && (\n <FormControl sx={{ minWidth: 120 }} size=\"small\">\n <InputLabel id=\"ability-select-label\">\n {t('launchModel.modelAbility')}\n </InputLabel>\n <Select\n id=\"ability\"\n labelId=\"ability-select-label\"\n label=\"Model Ability\"\n onChange={(e) =>\n handleChangeFilter('audioModelAbility', e.target.value)\n }\n value={audioModelAbility}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n {audioModelTypeArr.map((item) => (\n <MenuItem key={item} value={item}>\n {item}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )}\n <FormControl sx={{ minWidth: 120 }} size=\"small\">\n <InputLabel id=\"select-status\">{t('launchModel.status')}</InputLabel>\n <Select\n id=\"status\"\n labelId=\"select-status\"\n label={t('launchModel.status')}\n onChange={(e) => handleChangeFilter('status', e.target.value)}\n value={status}\n size=\"small\"\n sx={{ width: '150px' }}\n >\n <MenuItem value=\"cached\">{t('launchModel.cached')}</MenuItem>\n <MenuItem value=\"favorite\">{t('launchModel.favorite')}</MenuItem>\n </Select>\n </FormControl>\n\n <FormControl sx={{ marginTop: 1 }} variant=\"outlined\" margin=\"normal\">\n <HotkeyFocusTextField\n id=\"search\"\n type=\"search\"\n label={t('launchModel.search')}\n value={searchTerm}\n onChange={(e) => setSearchTerm(e.target.value)}\n size=\"small\"\n hotkey=\"Enter\"\n t={t}\n />\n </FormControl>\n </div>\n <div style={{ margin: '0 0 30px 30px' }}>\n {filterArr.map((item, index) => (\n <Chip\n key={index}\n label={t(`launchModel.${item}`)}\n variant=\"outlined\"\n size=\"small\"\n color=\"primary\"\n style={{ marginRight: 10 }}\n onDelete={() => handleDeleteChip(item)}\n />\n ))}\n </div>\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n gridGap: '2rem 0rem',\n }}\n >\n {registrationData\n .filter((registration) => filter(registration))\n .sort((a, b) => {\n if (modelListType === 'featured') {\n const indexA = featureModels.indexOf(a.model_name)\n const indexB = featureModels.indexOf(b.model_name)\n return (\n (indexA !== -1 ? indexA : Infinity) -\n (indexB !== -1 ? indexB : Infinity)\n )\n }\n return 0\n })\n .map((filteredRegistration) => (\n <ModelCard\n key={filteredRegistration.model_name}\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n modelType={modelType}\n onHandleCompleteDelete={handleCompleteDelete}\n onGetCollectionArr={getCollectionArr}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchModelComponent\n"],"mappings":"kSAA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AC,CAAC,CAAGA,MAAM,CAAGC,QAAQ,CAAC,CAEvC,CACA,MAAO,EAAC,CACV,CAAC,CAAC,CACDd,GAAG,CAAC,SAACe,oBAAoB,qBACxBlK,IAAA,CAACF,SAAS,EAERqK,GAAG,CAAEtJ,QAAS,CACduJ,SAAS,CAAEF,oBAAqB,CAChC1J,YAAY,CAAEA,YAAa,CAC3BD,SAAS,CAAEA,SAAU,CACrB8J,sBAAsB,CAAE5E,oBAAqB,CAC7C6E,kBAAkB,CAAEvD,gBAAiB,EANhCmD,oBAAoB,CAAC/F,UAO3B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAA9D,oBAAoB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _defineProperty from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{AddBoxOutlined,ChevronRightOutlined,DnsOutlined,GitHub,RocketLaunchOutlined,SmartToyOutlined}from'@mui/icons-material';import{Box,Drawer,List,ListItem,ListItemButton,ListItemIcon,ListItemText,Typography,useTheme}from'@mui/material';import{useEffect,useState}from'react';import{useTranslation}from'react-i18next';import{useLocation,useNavigate}from'react-router-dom';import icon from'../media/icon.webp';import ThemeButton from'./themeButton';import TranslateButton from'./translateButton';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var MenuSide=function MenuSide(){var theme=useTheme();var _useLocation=useLocation(),pathname=_useLocation.pathname;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),active=_useState2[0],setActive=_useState2[1];var navigate=useNavigate();var _useState3=useState(\"\".concat(Math.min(Math.max(window.innerWidth*0.2,287),320),\"px\")),_useState4=_slicedToArray(_useState3,2),drawerWidth=_useState4[0],setDrawerWidth=_useState4[1];var _useTranslation=useTranslation(),t=_useTranslation.t;var navItems=[{text:'launch_model',label:t('menu.launchModel'),icon:/*#__PURE__*/_jsx(RocketLaunchOutlined,{})},{text:'running_models',label:t('menu.runningModels'),icon:/*#__PURE__*/_jsx(SmartToyOutlined,{})},{text:'register_model',label:t('menu.registerModel'),icon:/*#__PURE__*/_jsx(AddBoxOutlined,{})},{text:'cluster_information',label:t('menu.clusterInfo'),icon:/*#__PURE__*/_jsx(DnsOutlined,{})},{text:'contact_us',label:t('menu.contactUs'),icon:/*#__PURE__*/_jsx(GitHub,{})}];useEffect(function(){setActive(pathname.substring(1));},[pathname]);useEffect(function(){var screenWidth=window.innerWidth;var maxDrawerWidth=Math.min(Math.max(screenWidth*0.2,287),320);setDrawerWidth(\"\".concat(maxDrawerWidth,\"px\"));// Update the drawer width on window resize\nvar handleResize=function handleResize(){var newScreenWidth=window.innerWidth;var newMaxDrawerWidth=Math.min(Math.max(newScreenWidth*0.2,287),320);setDrawerWidth(\"\".concat(newMaxDrawerWidth,\"px\"));};window.addEventListener('resize',handleResize);return function(){window.removeEventListener('resize',handleResize);};},[]);return/*#__PURE__*/_jsxs(Drawer,{variant:\"permanent\",sx:_objectSpread(_objectSpread({width:drawerWidth},theme.mixins.toolbar),{},_defineProperty({flexShrink:0},\"& .MuiDrawer-paper\",{width:drawerWidth,boxSizing:'border-box'})),style:{zIndex:1},children:[/*#__PURE__*/_jsx(Box,{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",width:\"100%\",children:/*#__PURE__*/_jsx(Box,{display:\"flex\",m:\"2rem 1rem 0rem 1rem\",width:\"217px\",children:/*#__PURE__*/_jsxs(Box,{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",textTransform:\"none\",children:[/*#__PURE__*/_jsx(Box,{component:\"img\",alt:\"profile\",src:icon,height:\"60px\",width:\"60px\",borderRadius:\"50%\",sx:{objectFit:'cover',mr:1.5}}),/*#__PURE__*/_jsx(Box,{textAlign:\"left\",children:/*#__PURE__*/_jsx(Typography,{fontWeight:\"bold\",fontSize:\"1.7rem\",children:'Xinference'})})]})})}),/*#__PURE__*/_jsx(Box,{sx:{flexGrow:1},children:/*#__PURE__*/_jsxs(Box,{width:\"100%\",children:[/*#__PURE__*/_jsx(Box,{m:\"1.5rem 2rem 2rem 3rem\"}),/*#__PURE__*/_jsx(List,{children:navItems.map(function(_ref){var text=_ref.text,label=_ref.label,icon=_ref.icon;if(!icon){return/*#__PURE__*/_jsx(Typography,{sx:{m:'2.25rem 0 1rem 3rem'},children:label},text);}return/*#__PURE__*/_jsx(ListItem,{children:/*#__PURE__*/_jsxs(ListItemButton,{onClick:function onClick(){if(text==='contact_us'){window.open('https://github.com/xorbitsai/inference','_blank','noreferrer');}else if(text==='launch_model'){sessionStorage.setItem('modelType','/launch_model/llm');navigate('/launch_model/llm');setActive(text);sessionStorage.setItem('lastActiveUrl',text);console.log(active);}else if(text==='cluster_information'){navigate('/cluster_info');setActive(text);}else if(text==='running_models'){navigate('/running_models/LLM');sessionStorage.setItem('runningModelType','/running_models/LLM');setActive(text);sessionStorage.setItem('lastActiveUrl',text);console.log(active);}else if(text==='register_model'){sessionStorage.setItem('registerModelType','/register_model/llm');navigate('/register_model/llm');setActive(text);sessionStorage.setItem('lastActiveUrl',text);console.log(active);}else{navigate(\"/\".concat(text));setActive(text);console.log(active);}},children:[/*#__PURE__*/_jsx(ListItemIcon,{sx:{ml:'2rem'},children:icon}),/*#__PURE__*/_jsx(ListItemText,{primary:label}),/*#__PURE__*/_jsx(ChevronRightOutlined,{sx:{ml:'auto'}})]})},text);})})]})}),/*#__PURE__*/_jsxs(Box,{display:\"flex\",alignItems:\"center\",marginLeft:'3rem',children:[/*#__PURE__*/_jsx(ThemeButton,{sx:{m:'1rem'}}),/*#__PURE__*/_jsx(TranslateButton,{})]})]});};export default MenuSide;","map":{"version":3,"names":["AddBoxOutlined","ChevronRightOutlined","DnsOutlined","GitHub","RocketLaunchOutlined","SmartToyOutlined","Box","Drawer","List","ListItem","ListItemButton","ListItemIcon","ListItemText","Typography","useTheme","useEffect","useState","useTranslation","useLocation","useNavigate","icon","ThemeButton","TranslateButton","jsx","_jsx","jsxs","_jsxs","MenuSide","theme","_useLocation","pathname","_useState","_useState2","_slicedToArray","active","setActive","navigate","_useState3","concat","Math","min","max","window","innerWidth","_useState4","drawerWidth","setDrawerWidth","_useTranslation","t","navItems","text","label","substring","screenWidth","maxDrawerWidth","handleResize","newScreenWidth","newMaxDrawerWidth","addEventListener","removeEventListener","variant","sx","_objectSpread","width","mixins","toolbar","_defineProperty","flexShrink","boxSizing","style","zIndex","children","display","justifyContent","alignItems","m","textTransform","component","alt","src","height","borderRadius","objectFit","mr","textAlign","fontWeight","fontSize","flexGrow","map","_ref","onClick","open","sessionStorage","setItem","console","log","ml","primary","marginLeft"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/components/MenuSide.js"],"sourcesContent":["import {\n AddBoxOutlined,\n ChevronRightOutlined,\n DnsOutlined,\n GitHub,\n RocketLaunchOutlined,\n SmartToyOutlined,\n} from '@mui/icons-material'\nimport {\n Box,\n Drawer,\n List,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Typography,\n useTheme,\n} from '@mui/material'\nimport { useEffect, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useLocation, useNavigate } from 'react-router-dom'\n\nimport icon from '../media/icon.webp'\nimport ThemeButton from './themeButton'\nimport TranslateButton from './translateButton'\n\nconst MenuSide = () => {\n const theme = useTheme()\n const { pathname } = useLocation()\n const [active, setActive] = useState('')\n const navigate = useNavigate()\n const [drawerWidth, setDrawerWidth] = useState(\n `${Math.min(Math.max(window.innerWidth * 0.2, 287), 320)}px`\n )\n const { t } = useTranslation()\n\n const navItems = [\n {\n text: 'launch_model',\n label: t('menu.launchModel'),\n icon: <RocketLaunchOutlined />,\n },\n {\n text: 'running_models',\n label: t('menu.runningModels'),\n icon: <SmartToyOutlined />,\n },\n {\n text: 'register_model',\n label: t('menu.registerModel'),\n icon: <AddBoxOutlined />,\n },\n {\n text: 'cluster_information',\n label: t('menu.clusterInfo'),\n icon: <DnsOutlined />,\n },\n {\n text: 'contact_us',\n label: t('menu.contactUs'),\n icon: <GitHub />,\n },\n ]\n\n useEffect(() => {\n setActive(pathname.substring(1))\n }, [pathname])\n\n useEffect(() => {\n const screenWidth = window.innerWidth\n const maxDrawerWidth = Math.min(Math.max(screenWidth * 0.2, 287), 320)\n setDrawerWidth(`${maxDrawerWidth}px`)\n\n // Update the drawer width on window resize\n const handleResize = () => {\n const newScreenWidth = window.innerWidth\n const newMaxDrawerWidth = Math.min(\n Math.max(newScreenWidth * 0.2, 287),\n 320\n )\n setDrawerWidth(`${newMaxDrawerWidth}px`)\n }\n\n window.addEventListener('resize', handleResize)\n return () => {\n window.removeEventListener('resize', handleResize)\n }\n }, [])\n\n return (\n <Drawer\n variant=\"permanent\"\n sx={{\n width: drawerWidth,\n ...theme.mixins.toolbar,\n flexShrink: 0,\n [`& .MuiDrawer-paper`]: {\n width: drawerWidth,\n boxSizing: 'border-box',\n },\n }}\n style={{ zIndex: 1 }}\n >\n {/* Title */}\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n width=\"100%\"\n >\n <Box display=\"flex\" m=\"2rem 1rem 0rem 1rem\" width=\"217px\">\n <Box\n display=\"flex\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n textTransform=\"none\"\n >\n <Box\n component=\"img\"\n alt=\"profile\"\n src={icon}\n height=\"60px\"\n width=\"60px\"\n borderRadius=\"50%\"\n sx={{ objectFit: 'cover', mr: 1.5 }}\n />\n <Box textAlign=\"left\">\n <Typography fontWeight=\"bold\" fontSize=\"1.7rem\">\n {'Xinference'}\n </Typography>\n </Box>\n </Box>\n </Box>\n </Box>\n\n <Box sx={{ flexGrow: 1 }}>\n <Box width=\"100%\">\n <Box m=\"1.5rem 2rem 2rem 3rem\"></Box>\n <List>\n {navItems.map(({ text, label, icon }) => {\n if (!icon) {\n return (\n <Typography key={text} sx={{ m: '2.25rem 0 1rem 3rem' }}>\n {label}\n </Typography>\n )\n }\n return (\n <ListItem key={text}>\n <ListItemButton\n onClick={() => {\n if (text === 'contact_us') {\n window.open(\n 'https://github.com/xorbitsai/inference',\n '_blank',\n 'noreferrer'\n )\n } else if (text === 'launch_model') {\n sessionStorage.setItem('modelType', '/launch_model/llm')\n navigate('/launch_model/llm')\n setActive(text)\n sessionStorage.setItem('lastActiveUrl', text)\n console.log(active)\n } else if (text === 'cluster_information') {\n navigate('/cluster_info')\n setActive(text)\n } else if (text === 'running_models') {\n navigate('/running_models/LLM')\n sessionStorage.setItem(\n 'runningModelType',\n '/running_models/LLM'\n )\n setActive(text)\n sessionStorage.setItem('lastActiveUrl', text)\n console.log(active)\n } else if (text === 'register_model') {\n sessionStorage.setItem(\n 'registerModelType',\n '/register_model/llm'\n )\n navigate('/register_model/llm')\n setActive(text)\n sessionStorage.setItem('lastActiveUrl', text)\n console.log(active)\n } else {\n navigate(`/${text}`)\n setActive(text)\n console.log(active)\n }\n }}\n >\n <ListItemIcon\n sx={{\n ml: '2rem',\n }}\n >\n {icon}\n </ListItemIcon>\n <ListItemText primary={label} />\n <ChevronRightOutlined sx={{ ml: 'auto' }} />\n </ListItemButton>\n </ListItem>\n )\n })}\n </List>\n </Box>\n </Box>\n\n <Box display=\"flex\" alignItems=\"center\" marginLeft={'3rem'}>\n <ThemeButton sx={{ m: '1rem' }} />\n <TranslateButton />\n </Box>\n </Drawer>\n )\n}\n\nexport default MenuSide\n"],"mappings":"waAAA,OACEA,cAAc,CACdC,oBAAoB,CACpBC,WAAW,CACXC,MAAM,CACNC,oBAAoB,CACpBC,gBAAgB,KACX,qBAAqB,CAC5B,OACEC,GAAG,CACHC,MAAM,CACNC,IAAI,CACJC,QAAQ,CACRC,cAAc,CACdC,YAA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KAAM,CAAE,CAAC,cAChC3B,IAAA,CAACvB,oBAAoB,EAAC4D,EAAE,CAAE,CAAEmC,EAAE,CAAE,MAAO,CAAE,CAAE,CAAC,EAC9B,CAAC,EApDJ9C,IAqDL,CAAC,CAEf,CAAC,CAAC,CACE,CAAC,EACJ,CAAC,CACH,CAAC,cAENxB,KAAA,CAACpB,GAAG,EAACkE,OAAO,CAAC,MAAM,CAACE,UAAU,CAAC,QAAQ,CAACwB,UAAU,CAAE,MAAO,CAAA3B,QAAA,eACzD/C,IAAA,CAACH,WAAW,EAACwC,EAAE,CAAE,CAAEc,CAAC,CAAE,MAAO,CAAE,CAAE,CAAC,cAClCnD,IAAA,CAACF,eAAe,GAAE,CAAC,EAChB,CAAC,EACA,CAAC,CAEb,CAAC,CAED,cAAe,CAAAK,QAAQ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
/xinference/web/ui/build/static/js/{main.91e77b5c.js.LICENSE.txt → main.ae579a97.js.LICENSE.txt}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|