xinference 0.8.1__py3-none-any.whl → 0.8.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xinference might be problematic. Click here for more details.

Files changed (95) hide show
  1. xinference/_version.py +3 -3
  2. xinference/api/oauth2/auth_service.py +132 -0
  3. xinference/api/restful_api.py +282 -78
  4. xinference/client/handlers.py +3 -0
  5. xinference/client/restful/restful_client.py +108 -75
  6. xinference/constants.py +14 -4
  7. xinference/core/cache_tracker.py +102 -0
  8. xinference/core/chat_interface.py +10 -4
  9. xinference/core/event.py +56 -0
  10. xinference/core/model.py +44 -0
  11. xinference/core/resource.py +19 -12
  12. xinference/core/status_guard.py +4 -0
  13. xinference/core/supervisor.py +278 -87
  14. xinference/core/utils.py +68 -3
  15. xinference/core/worker.py +98 -8
  16. xinference/deploy/cmdline.py +6 -3
  17. xinference/deploy/local.py +2 -2
  18. xinference/deploy/supervisor.py +2 -2
  19. xinference/model/audio/__init__.py +27 -0
  20. xinference/model/audio/core.py +161 -0
  21. xinference/model/audio/model_spec.json +79 -0
  22. xinference/model/audio/utils.py +18 -0
  23. xinference/model/audio/whisper.py +132 -0
  24. xinference/model/core.py +18 -13
  25. xinference/model/embedding/__init__.py +27 -2
  26. xinference/model/embedding/core.py +43 -3
  27. xinference/model/embedding/model_spec.json +24 -0
  28. xinference/model/embedding/model_spec_modelscope.json +24 -0
  29. xinference/model/embedding/utils.py +18 -0
  30. xinference/model/image/__init__.py +12 -1
  31. xinference/model/image/core.py +63 -9
  32. xinference/model/image/utils.py +26 -0
  33. xinference/model/llm/__init__.py +20 -1
  34. xinference/model/llm/core.py +43 -2
  35. xinference/model/llm/ggml/chatglm.py +15 -6
  36. xinference/model/llm/llm_family.json +197 -6
  37. xinference/model/llm/llm_family.py +9 -7
  38. xinference/model/llm/llm_family_modelscope.json +189 -4
  39. xinference/model/llm/pytorch/chatglm.py +3 -3
  40. xinference/model/llm/pytorch/core.py +4 -2
  41. xinference/model/{multimodal → llm/pytorch}/qwen_vl.py +10 -8
  42. xinference/model/llm/pytorch/utils.py +21 -9
  43. xinference/model/llm/pytorch/yi_vl.py +246 -0
  44. xinference/model/llm/utils.py +57 -4
  45. xinference/model/llm/vllm/core.py +5 -4
  46. xinference/model/rerank/__init__.py +25 -2
  47. xinference/model/rerank/core.py +51 -9
  48. xinference/model/rerank/model_spec.json +6 -0
  49. xinference/model/rerank/model_spec_modelscope.json +7 -0
  50. xinference/{api/oauth2/common.py → model/rerank/utils.py} +6 -2
  51. xinference/model/utils.py +5 -3
  52. xinference/thirdparty/__init__.py +0 -0
  53. xinference/thirdparty/llava/__init__.py +1 -0
  54. xinference/thirdparty/llava/conversation.py +205 -0
  55. xinference/thirdparty/llava/mm_utils.py +122 -0
  56. xinference/thirdparty/llava/model/__init__.py +1 -0
  57. xinference/thirdparty/llava/model/clip_encoder/__init__.py +0 -0
  58. xinference/thirdparty/llava/model/clip_encoder/builder.py +11 -0
  59. xinference/thirdparty/llava/model/clip_encoder/clip_encoder.py +86 -0
  60. xinference/thirdparty/llava/model/constants.py +6 -0
  61. xinference/thirdparty/llava/model/llava_arch.py +385 -0
  62. xinference/thirdparty/llava/model/llava_llama.py +163 -0
  63. xinference/thirdparty/llava/model/multimodal_projector/__init__.py +0 -0
  64. xinference/thirdparty/llava/model/multimodal_projector/builder.py +64 -0
  65. xinference/types.py +1 -1
  66. xinference/web/ui/build/asset-manifest.json +3 -3
  67. xinference/web/ui/build/index.html +1 -1
  68. xinference/web/ui/build/static/js/main.15822aeb.js +3 -0
  69. xinference/web/ui/build/static/js/main.15822aeb.js.map +1 -0
  70. xinference/web/ui/node_modules/.cache/babel-loader/139e5e4adf436923107d2b02994c7ff6dba2aac1989e9b6638984f0dfe782c4a.json +1 -0
  71. xinference/web/ui/node_modules/.cache/babel-loader/52aa27272b4b9968f62666262b47661cb1992336a2aff3b13994cc36877b3ec3.json +1 -0
  72. xinference/web/ui/node_modules/.cache/babel-loader/64accc515dc6cd584a2873796cd7da6f93de57f7e465eb5423cca9a2f3fe3eff.json +1 -0
  73. xinference/web/ui/node_modules/.cache/babel-loader/65ca3ba225b8c8dac907210545b51f2fcdb2591f0feeb7195f1c037f2bc956a0.json +1 -0
  74. xinference/web/ui/node_modules/.cache/babel-loader/b80db1012318b97c329c4e3e72454f7512fb107e57c444b437dbe4ba1a3faa5a.json +1 -0
  75. {xinference-0.8.1.dist-info → xinference-0.8.3.dist-info}/METADATA +33 -23
  76. {xinference-0.8.1.dist-info → xinference-0.8.3.dist-info}/RECORD +81 -64
  77. xinference/api/oauth2/core.py +0 -93
  78. xinference/model/multimodal/__init__.py +0 -52
  79. xinference/model/multimodal/core.py +0 -467
  80. xinference/model/multimodal/model_spec.json +0 -43
  81. xinference/model/multimodal/model_spec_modelscope.json +0 -45
  82. xinference/web/ui/build/static/js/main.b83095c2.js +0 -3
  83. xinference/web/ui/build/static/js/main.b83095c2.js.map +0 -1
  84. xinference/web/ui/node_modules/.cache/babel-loader/101923c539819f26ad11fbcbd6f6e56436b285efbb090dcc7dd648c6e924c4a8.json +0 -1
  85. xinference/web/ui/node_modules/.cache/babel-loader/4942da6bc03bf7373af068e22f916341aabc5b5df855d73c1d348c696724ce37.json +0 -1
  86. xinference/web/ui/node_modules/.cache/babel-loader/52a6136cb2dbbf9c51d461724d9b283ebe74a73fb19d5df7ba8e13c42bd7174d.json +0 -1
  87. xinference/web/ui/node_modules/.cache/babel-loader/71493aadd34d568fbe605cacaba220aa69bd09273251ee4ba27930f8d01fccd8.json +0 -1
  88. xinference/web/ui/node_modules/.cache/babel-loader/8b071db2a5a9ef68dc14d5f606540bd23d9785e365a11997c510656764d2dccf.json +0 -1
  89. xinference/web/ui/node_modules/.cache/babel-loader/a4d72d3b806ba061919115f0c513738726872e3c79cf258f007519d3f91d1a16.json +0 -1
  90. xinference/web/ui/node_modules/.cache/babel-loader/f037ffef5992af0892d6d991053c1dace364cd39a3f11f1a41f92776e8a59459.json +0 -1
  91. /xinference/web/ui/build/static/js/{main.b83095c2.js.LICENSE.txt → main.15822aeb.js.LICENSE.txt} +0 -0
  92. {xinference-0.8.1.dist-info → xinference-0.8.3.dist-info}/LICENSE +0 -0
  93. {xinference-0.8.1.dist-info → xinference-0.8.3.dist-info}/WHEEL +0 -0
  94. {xinference-0.8.1.dist-info → xinference-0.8.3.dist-info}/entry_points.txt +0 -0
  95. {xinference-0.8.1.dist-info → xinference-0.8.3.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
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 DeleteOutlineOutlinedIcon from'@mui/icons-material/DeleteOutlineOutlined';import OpenInBrowserOutlinedIcon from'@mui/icons-material/OpenInBrowserOutlined';import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Stack,Tab}from'@mui/material';import{DataGrid}from'@mui/x-data-grid';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetcher from'../../components/fetcher';import Title from'../../components/Title';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var RunningModels=function RunningModels(){var _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var _useState=useState([]),_useState2=_slicedToArray(_useState,2),llmData=_useState2[0],setLlmData=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),multimodalData=_useState4[0],setMultimodalData=_useState4[1];var _useState5=useState([]),_useState6=_slicedToArray(_useState5,2),embeddingModelData=_useState6[0],setEmbeddingModelData=_useState6[1];var _useState7=useState([]),_useState8=_slicedToArray(_useState7,2),imageModelData=_useState8[0],setImageModelData=_useState8[1];var _useState9=useState([]),_useState10=_slicedToArray(_useState9,2),rerankModelData=_useState10[0],setRerankModelData=_useState10[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel,setIsUpdatingModel=_useContext2.setIsUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var endPoint=useContext(ApiContext).endPoint;var handleTabChange=function handleTabChange(event,newValue){setTabValue(newValue);};var update=function update(isCallingApi){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token==='need_auth'){navigate('/login',{replace:true});return;}if(isCallingApi){setLlmData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setMultimodalData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setEmbeddingModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setImageModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setRerankModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);}else{setIsUpdatingModel(true);fetcher(\"\".concat(endPoint,\"/v1/models/\"),{method:'GET'}).then(function(response){if(!response.ok){response.json().then(function(errorData){setErrorMsg(\"Login failed: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{response.json().then(function(data){var newLlmData=[];var newMultimodalData=[];var newEmbeddingModelData=[];var newImageModelData=[];var newRerankModelData=[];Object.entries(data).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];var newValue=_objectSpread(_objectSpread({},value),{},{id:key,url:key});if(newValue.model_type==='LLM'){newLlmData.push(newValue);}else if(newValue.model_type==='multimodal'){newMultimodalData.push(newValue);}else if(newValue.model_type==='embedding'){newEmbeddingModelData.push(newValue);}else if(newValue.model_type==='image'){newImageModelData.push(newValue);}else if(newValue.model_type==='rerank'){newRerankModelData.push(newValue);}});setLlmData(newLlmData);setMultimodalData(newMultimodalData);setEmbeddingModelData(newEmbeddingModelData);setImageModelData(newImageModelData);setRerankModelData(newRerankModelData);setIsUpdatingModel(false);});}}).catch(function(error){console.error('Error:',error);setIsUpdatingModel(false);});}};useEffect(function(){update(isCallingApi);// eslint-disable-next-line\n},[isCallingApi,cookie.token]);var llmColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:'Name',flex:1},{field:'address',headerName:'Address',flex:1},{field:'accelerators',headerName:'GPU Indexes',flex:1},{field:'model_size_in_billions',headerName:'Size',flex:1},{field:'quantization',headerName:'Quantization',flex:1},{field:'url',headerName:'Actions',flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref3){var row=_ref3.row;var url=row.url;var openUrl=\"\".concat(endPoint,\"/\")+url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;var gradioUrl=\"\".concat(endPoint,\"/v1/ui/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsxs(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch Web UI\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){// Make sure no ongoing call\nreturn;}setIsCallingApi(true);fetcher(openUrl,{method:'HEAD'}).then(function(response){if(response.status===404){// If web UI doesn't exist (404 Not Found)\nconsole.log('UI does not exist, creating new...');return fetcher(gradioUrl,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model_type:row.model_type,model_name:row.model_name,model_size_in_billions:row.model_size_in_billions,model_format:row.model_format,quantization:row.quantization,context_length:row.context_length,model_ability:row.model_ability,model_description:row.model_description,model_lang:row.model_lang})}).then(function(response){return response.json();}).then(function(){return window.open(openUrl,'_blank','noopener noreferrer');}).finally(function(){return setIsCallingApi(false);});}else if(response.ok){// If web UI does exist\nconsole.log('UI exists, opening...');window.open(openUrl,'_blank','noopener noreferrer');setIsCallingApi(false);}else{// Other HTTP errors\nconsole.error(\"Unexpected response status: \".concat(response.status));setIsCallingApi(false);}}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(OpenInBrowserOutlinedIcon,{})})}),/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})]});}}];var embeddingModelColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:'Name',flex:1},{field:'address',headerName:'Address',flex:1},{field:'accelerators',headerName:'GPU Indexes',flex:1},{field:'url',headerName:'Actions',flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref4){var row=_ref4.row;var url=row.url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsx(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})});}}];var imageModelColumns=embeddingModelColumns;var rerankModelColumns=embeddingModelColumns;var dataGridStyle={'& .MuiDataGrid-cell':{borderBottom:'none'},'& .MuiDataGrid-columnHeaders':{borderBottom:'none'},'& .MuiDataGrid-columnHeaderTitle':{fontWeight:'bold'},'& .MuiDataGrid-virtualScroller':{overflowX:'visible !important',overflow:'visible'},'& .MuiDataGrid-footerContainer':{borderTop:'none'},'border-width':'0px'};var noRowsOverlay=function noRowsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models\"});};var noResultsOverlay=function noResultsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models Matches\"});};return/*#__PURE__*/_jsxs(Box,{sx:{height:'100%',width:'100%',paddingLeft:'20px',paddingTop:'20px'},children:[/*#__PURE__*/_jsx(Title,{title:\"Running Models\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:tabValue,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Models\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Multimodal Models\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"3\"}),/*#__PURE__*/_jsx(Tab,{label:\"Image models\",value:\"4\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank models\",value:\"5\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"1\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:llmData,columns:llmColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:multimodalData,columns:llmColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:embeddingModelData,columns:embeddingModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"4\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:imageModelData,columns:imageModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"5\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:rerankModelData,columns:rerankModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})})]})]});};export default RunningModels;","map":{"version":3,"names":["DeleteOutlineOutlinedIcon","OpenInBrowserOutlinedIcon","TabContext","TabList","TabPanel","Box","Stack","Tab","DataGrid","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","fetcher","Title","jsx","_jsx","jsxs","_jsxs","RunningModels","_React$useState","_React$useState2","_slicedToArray","tabValue","setTabValue","_useState","_useState2","llmData","setLlmData","_useState3","_useState4","multimodalData","setMultimodalData","_useState5","_useState6","embeddingModelData","setEmbeddingModelData","_useState7","_useState8","imageModelData","setImageModelData","_useState9","_useState10","rerankModelData","setRerankModelData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","setIsUpdatingModel","_useContext3","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","endPoint","handleTabChange","event","newValue","update","token","undefined","replace","id","url","concat","method","then","response","ok","json","errorData","status","detail","data","newLlmData","newMultimodalData","newEmbeddingModelData","newImageModelData","newRerankModelData","Object","entries","forEach","_ref","_ref2","key","value","_objectSpread","model_type","push","catch","error","console","llmColumns","field","headerName","flex","minWidth","sortable","filterable","disableColumnMenu","renderCell","_ref3","row","openUrl","closeUrl","gradioUrl","style","width","display","justifyContent","alignItems","children","title","borderWidth","backgroundColor","paddingLeft","paddingRight","onClick","log","headers","body","JSON","stringify","model_name","model_size_in_billions","model_format","quantization","context_length","model_ability","model_description","model_lang","window","open","finally","m","p","borderRadius","border","borderColor","embeddingModelColumns","_ref4","imageModelColumns","rerankModelColumns","dataGridStyle","borderBottom","fontWeight","overflowX","overflow","borderTop","noRowsOverlay","height","noResultsOverlay","sx","paddingTop","onChange","label","padding","rows","columns","autoHeight","slots"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/running_models/index.js"],"sourcesContent":["import DeleteOutlineOutlinedIcon from '@mui/icons-material/DeleteOutlineOutlined'\nimport OpenInBrowserOutlinedIcon from '@mui/icons-material/OpenInBrowserOutlined'\nimport { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Stack, Tab } from '@mui/material'\nimport { DataGrid } from '@mui/x-data-grid'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetcher from '../../components/fetcher'\nimport Title from '../../components/Title'\n\nconst RunningModels = () => {\n const [tabValue, setTabValue] = React.useState('1')\n const [llmData, setLlmData] = useState([])\n const [multimodalData, setMultimodalData] = useState([])\n const [embeddingModelData, setEmbeddingModelData] = useState([])\n const [imageModelData, setImageModelData] = useState([])\n const [rerankModelData, setRerankModelData] = useState([])\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel, setIsUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n const endPoint = useContext(ApiContext).endPoint\n\n const handleTabChange = (event, newValue) => {\n setTabValue(newValue)\n }\n\n const update = (isCallingApi) => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token === 'need_auth') {\n navigate('/login', { replace: true })\n return\n }\n if (isCallingApi) {\n setLlmData([{ id: 'Loading, do not refresh page...', url: 'IS_LOADING' }])\n setMultimodalData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setEmbeddingModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setImageModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setRerankModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n } else {\n setIsUpdatingModel(true)\n fetcher(`${endPoint}/v1/models/`, {\n method: 'GET',\n })\n .then((response) => {\n if (!response.ok) {\n response.json().then((errorData) => {\n setErrorMsg(\n `Login failed: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n response.json().then((data) => {\n const newLlmData = []\n const newMultimodalData = []\n const newEmbeddingModelData = []\n const newImageModelData = []\n const newRerankModelData = []\n Object.entries(data).forEach(([key, value]) => {\n let newValue = {\n ...value,\n id: key,\n url: key,\n }\n if (newValue.model_type === 'LLM') {\n newLlmData.push(newValue)\n } else if (newValue.model_type === 'multimodal') {\n newMultimodalData.push(newValue)\n } else if (newValue.model_type === 'embedding') {\n newEmbeddingModelData.push(newValue)\n } else if (newValue.model_type === 'image') {\n newImageModelData.push(newValue)\n } else if (newValue.model_type === 'rerank') {\n newRerankModelData.push(newValue)\n }\n })\n setLlmData(newLlmData)\n setMultimodalData(newMultimodalData)\n setEmbeddingModelData(newEmbeddingModelData)\n setImageModelData(newImageModelData)\n setRerankModelData(newRerankModelData)\n setIsUpdatingModel(false)\n })\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsUpdatingModel(false)\n })\n }\n }\n\n useEffect(() => {\n update(isCallingApi)\n // eslint-disable-next-line\n }, [isCallingApi, cookie.token])\n\n const llmColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: 'Name',\n flex: 1,\n },\n {\n field: 'address',\n headerName: 'Address',\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: 'GPU Indexes',\n flex: 1,\n },\n {\n field: 'model_size_in_billions',\n headerName: 'Size',\n flex: 1,\n },\n {\n field: 'quantization',\n headerName: 'Quantization',\n flex: 1,\n },\n {\n field: 'url',\n headerName: 'Actions',\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url\n const openUrl = `${endPoint}/` + url\n const closeUrl = `${endPoint}/v1/models/` + url\n const gradioUrl = `${endPoint}/v1/ui/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Launch Web UI\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n // Make sure no ongoing call\n return\n }\n\n setIsCallingApi(true)\n\n fetcher(openUrl, {\n method: 'HEAD',\n })\n .then((response) => {\n if (response.status === 404) {\n // If web UI doesn't exist (404 Not Found)\n console.log('UI does not exist, creating new...')\n return fetcher(gradioUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model_type: row.model_type,\n model_name: row.model_name,\n model_size_in_billions: row.model_size_in_billions,\n model_format: row.model_format,\n quantization: row.quantization,\n context_length: row.context_length,\n model_ability: row.model_ability,\n model_description: row.model_description,\n model_lang: row.model_lang,\n }),\n })\n .then((response) => response.json())\n .then(() =>\n window.open(openUrl, '_blank', 'noopener noreferrer')\n )\n .finally(() => setIsCallingApi(false))\n } else if (response.ok) {\n // If web UI does exist\n console.log('UI exists, opening...')\n window.open(openUrl, '_blank', 'noopener noreferrer')\n setIsCallingApi(false)\n } else {\n // Other HTTP errors\n console.error(\n `Unexpected response status: ${response.status}`\n )\n setIsCallingApi(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <OpenInBrowserOutlinedIcon />\n </Box>\n </button>\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n\n const embeddingModelColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: 'Name',\n flex: 1,\n },\n {\n field: 'address',\n headerName: 'Address',\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: 'GPU Indexes',\n flex: 1,\n },\n {\n field: 'url',\n headerName: 'Actions',\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url\n const closeUrl = `${endPoint}/v1/models/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n\n const imageModelColumns = embeddingModelColumns\n const rerankModelColumns = embeddingModelColumns\n\n const dataGridStyle = {\n '& .MuiDataGrid-cell': {\n borderBottom: 'none',\n },\n '& .MuiDataGrid-columnHeaders': {\n borderBottom: 'none',\n },\n '& .MuiDataGrid-columnHeaderTitle': {\n fontWeight: 'bold',\n },\n '& .MuiDataGrid-virtualScroller': {\n overflowX: 'visible !important',\n overflow: 'visible',\n },\n '& .MuiDataGrid-footerContainer': {\n borderTop: 'none',\n },\n 'border-width': '0px',\n }\n\n const noRowsOverlay = () => {\n return (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models\n </Stack>\n )\n }\n\n const noResultsOverlay = () => {\n return (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models Matches\n </Stack>\n )\n }\n\n return (\n <Box\n sx={{\n height: '100%',\n width: '100%',\n paddingLeft: '20px',\n paddingTop: '20px',\n }}\n >\n <Title title=\"Running Models\" />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={handleTabChange}\n aria-label=\"tabs\"\n >\n <Tab label=\"Language Models\" value=\"1\" />\n <Tab label=\"Multimodal Models\" value=\"2\" />\n <Tab label=\"Embedding Models\" value=\"3\" />\n <Tab label=\"Image models\" value=\"4\" />\n <Tab label=\"Rerank models\" value=\"5\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={llmData}\n columns={llmColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={multimodalData}\n columns={llmColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={embeddingModelData}\n columns={embeddingModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"4\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={imageModelData}\n columns={imageModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"5\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={rerankModelData}\n columns={rerankModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RunningModels\n"],"mappings":"yRAAA,MAAO,CAAAA,yBAAyB,KAAM,2CAA2C,CACjF,MAAO,CAAAC,yBAAyB,KAAM,2CAA2C,CACjF,OAASC,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,KAAK,CAAEC,GAAG,KAAQ,eAAe,CAC/C,OAASC,QAAQ,KAAQ,kBAAkB,CAC3C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,K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EF,MAAM,CAAE,MAAM,CAAE3C,KAAK,CAAE,MAAO,CAAE,CAAAI,QAAA,cACzClG,IAAA,CAACZ,QAAQ,EACP4J,IAAI,CAAErH,eAAgB,CACtBsH,OAAO,CAAEhB,kBAAmB,CAC5BiB,UAAU,CAAE,IAAK,CACjBP,EAAE,CAAET,aAAc,CAClBiB,KAAK,CAAE,CACLX,aAAa,CAAEA,aAAa,CAC5BE,gBAAgB,CAAEA,gBACpB,CAAE,CACH,CAAC,CACC,CAAC,CACE,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAvI,aAAa"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
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,HelpCenterOutlined,RocketLaunchOutlined,UndoOutlined}from'@mui/icons-material';import DeleteIcon from'@mui/icons-material/Delete';import{Box,Chip,CircularProgress,FormControl,Grid,InputLabel,MenuItem,Select,Stack,TextField}from'@mui/material';import IconButton from'@mui/material/IconButton';import Typography from'@mui/material/Typography';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var CARD_HEIGHT=380;var CARD_WIDTH=300;var MultimodalCard=function MultimodalCard(_ref){var url=_ref.url,modelData=_ref.modelData,gpuAvailable=_ref.gpuAvailable,_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 _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;// Model parameter selections\nvar _useState5=useState(''),_useState6=_slicedToArray(_useState5,2),modelUID=_useState6[0],setModelUID=_useState6[1];var _useState7=useState(''),_useState8=_slicedToArray(_useState7,2),modelFormat=_useState8[0],setModelFormat=_useState8[1];var _useState9=useState(''),_useState10=_slicedToArray(_useState9,2),modelSize=_useState10[0],setModelSize=_useState10[1];var _useState11=useState(''),_useState12=_slicedToArray(_useState11,2),quantization=_useState12[0],setQuantization=_useState12[1];var _useState13=useState('auto'),_useState14=_slicedToArray(_useState13,2),nGPU=_useState14[0],setNGPU=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),formatOptions=_useState16[0],setFormatOptions=_useState16[1];var _useState17=useState([]),_useState18=_slicedToArray(_useState17,2),sizeOptions=_useState18[0],setSizeOptions=_useState18[1];var _useState19=useState([]),_useState20=_slicedToArray(_useState19,2),quantizationOptions=_useState20[0],setQuantizationOptions=_useState20[1];var _useState21=useState(false),_useState22=_slicedToArray(_useState21,2),customDeleted=_useState22[0],setCustomDeleted=_useState22[1];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){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]);var launchModel=function launchModel(url){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);var modelDataWithID={// If user does not fill model_uid, pass null (None) to server and server generates it.\nmodel_type:'multimodal',model_uid:modelUID.trim()===''?null:modelUID.trim(),model_name:modelData.model_name,model_format:modelFormat,model_size_in_billions:convertModelSize(modelSize),quantization:quantization,n_gpu:nGPU==='0'?null:nGPU==='auto'?'auto':parseInt(nGPU,10)};// 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{window.open(url+'/ui/#/running_models','_blank','noreferrer');}setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});};var styles={container:{display:'block',position:'relative',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',borderRadius:'20px',background:'white',overflow:'hidden'},containerSelected:{display:'block',position:'relative',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',borderRadius:'20px',background:'white',overflow:'hidden',boxShadow:'0 0 2px #00000099'},descriptionCard:{position:'relative',top:'-1px',left:'-1px',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',padding:'20px',borderRadius:'20px',background:'white'},parameterCard:{position:'relative',top:\"-\".concat(CARD_HEIGHT+1,\"px\"),left:'-1px',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',padding:'20px',borderRadius:'20px',background:'white'},img:{display:'block',margin:'0 auto',width:'180px',height:'180px',objectFit:'cover',borderRadius:'10px'},h2:{margin:'10px 10px',fontSize:'20px'},p:{minHeight:'140px',fontSize:'14px',padding:'0px 10px 15px 10px'},buttonsContainer:{display:'flex',margin:'0 auto',marginTop:'15px',border:'none',justifyContent:'space-between',alignItems:'center'},buttonContainer:{width:'45%',borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'0px'},buttonItem:{width:'100%',margin:'0 auto',padding:'5px',display:'flex',justifyContent:'center',borderRadius:'4px',border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},instructionText:{fontSize:'12px',color:'#666666',fontStyle:'italic',margin:'10px 0',textAlign:'center'},slideIn:{transform:'translateX(0%)',transition:'transform 0.2s ease-in-out'},slideOut:{transform:'translateX(100%)',transition:'transform 0.2s ease-in-out'},iconRow:{display:'flex',justifyContent:'space-between',alignItems:'center'},iconItem:{display:'flex',flexDirection:'column',alignItems:'center',margin:'20px'},boldIconText:{fontWeight:'bold',fontSize:'1.2em'},muiIcon:{fontSize:'1.5em'},smallText:{fontSize:'0.8em'},tagRow:{margin:'2px 5px'}};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(){return setCustomDeleted(true);}).catch(console.error);};// Set two different states based on mouse hover\nreturn/*#__PURE__*/_jsxs(Box,{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);}},children:[/*#__PURE__*/_jsxs(Box,{style:styles.descriptionCard,children:[is_custom&&/*#__PURE__*/_jsxs(Stack,{direction:\"row\",justifyContent:\"space-evenly\",alignItems:\"center\",spacing:1,children:[/*#__PURE__*/_jsx(Typography,{variant:\"h4\",gutterBottom:true,noWrap:true,children:modelData.model_name}),/*#__PURE__*/_jsx(IconButton,{\"aria-label\":\"delete\",onClick:handeCustomDelete,disabled:customDeleted,children:/*#__PURE__*/_jsx(DeleteIcon,{})})]}),!is_custom&&/*#__PURE__*/_jsx(\"h2\",{style:styles.h2,children: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\"});});}(),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\"});}}()]}),/*#__PURE__*/_jsx(\"p\",{style:styles.p,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:selected?_objectSpread(_objectSpread({},styles.parameterCard),styles.slideIn):_objectSpread(_objectSpread({},styles.parameterCard),styles.slideOut),children:[/*#__PURE__*/_jsx(\"h2\",{style:styles.h2,children:modelData.model_name}),/*#__PURE__*/_jsx(Box,{display:\"flex\",flexDirection:\"column\",width:\"100%\",mx:\"auto\",children:/*#__PURE__*/_jsxs(Grid,{container:true,rowSpacing:0,columnSpacing:1,children:[/*#__PURE__*/_jsx(Grid,{item:true,xs:6,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:6,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:6,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:6,children:/*#__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:['auto'].concat(range(0,modelFormat!=='pytorch'&&modelFormat!=='gptq'?1:gpuAvailable)).map(function(v){return/*#__PURE__*/_jsx(MenuItem,{value:v,children:v},v);})})]})}),/*#__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__*/_jsxs(Box,{style:styles.buttonsContainer,children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch\",style:styles.buttonContainer,onClick:function onClick(){return launchModel(url,modelData);},disabled:isCallingApi||isUpdatingModel||!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!=='pytorch')),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\"})})})]})]})]});};export default MultimodalCard;","map":{"version":3,"names":["ChatOutlined","EditNoteOutlined","HelpCenterOutlined","RocketLaunchOutlined","UndoOutlined","DeleteIcon","Box","Chip","CircularProgress","FormControl","Grid","InputLabel","MenuItem","Select","Stack","TextField","IconButton","Typography","React","useContext","useEffect","useState","ApiContext","fetcher","jsx","_jsx","jsxs","_jsxs","CARD_HEIGHT","CARD_WIDTH","MultimodalCard","_ref","url","modelData","gpuAvailable","_ref$is_custom","is_custom","_useState","_useState2","_slicedToArray","hover","setHover","_useState3","_useState4","selected","setSelected","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useContext3","setErrorMsg","_useState5","_useState6","modelUID","setModelUID","_useState7","_useState8","modelFormat","setModelFormat","_useState9","_useState10","modelSize","setModelSize","_useState11","_useState12","quantization","setQuantization","_useState13","_useState14","nGPU","setNGPU","_useState15","_useState16","formatOptions","setFormatOptions","_useState17","_useState18","sizeOptions","setSizeOptions","_useState19","_useState20","quantizationOptions","setQuantizationOptions","_useState21","_useState22","customDeleted","setCustomDeleted","range","start","end","Array","fill","undefined","map","_","i","isCached","spec","model_format","cache_status","some","cs","convertModelSize","size","toString","includes","parseInt","modelFamily","model_specs","formats","_toConsumableArray","Set","sizes","filter","model_size_in_billions","quants","flatMap","quantizations","launchModel","modelDataWithID","model_type","model_uid","trim","model_name","n_gpu","method","headers","body","JSON","stringify","then","response","ok","json","errorData","concat","status","detail","window","open","catch","error","console","styles","container","display","position","width","height","border","borderRadius","background","overflow","containerSelected","boxShadow","descriptionCard","top","left","padding","parameterCard","img","margin","objectFit","h2","fontSize","p","minHeight","buttonsContainer","marginTop","justifyContent","alignItems","buttonContainer","borderWidth","backgroundColor","paddingLeft","paddingRight","buttonItem","borderColor","instructionText","color","fontStyle","textAlign","slideIn","transform","transition","slideOut","iconRow","iconItem","flexDirection","boldIconText","fontWeight","muiIcon","smallText","tagRow","handeCustomDelete","e","stopPropagation","style","onMouseEnter","onMouseLeave","onClick","children","direction","spacing","variant","gutterBottom","noWrap","disabled","useFlexGap","flexWrap","sx","marginLeft","model_lang","v","label","model_description","Math","floor","context_length","model_ability","_objectSpread","mx","rowSpacing","columnSpacing","item","xs","fullWidth","id","labelId","value","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","title","is_builtin"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/multimodalCard.js"],"sourcesContent":["import {\n ChatOutlined,\n EditNoteOutlined,\n HelpCenterOutlined,\n RocketLaunchOutlined,\n UndoOutlined,\n} from '@mui/icons-material'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport {\n Box,\n Chip,\n CircularProgress,\n FormControl,\n Grid,\n InputLabel,\n MenuItem,\n Select,\n Stack,\n TextField,\n} from '@mui/material'\nimport IconButton from '@mui/material/IconButton'\nimport Typography from '@mui/material/Typography'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\n\nconst CARD_HEIGHT = 380\nconst CARD_WIDTH = 300\n\nconst MultimodalCard = ({\n url,\n modelData,\n gpuAvailable,\n is_custom = false,\n}) => {\n const [hover, setHover] = useState(false)\n const [selected, setSelected] = useState(false)\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\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\n const [formatOptions, setFormatOptions] = useState([])\n const [sizeOptions, setSizeOptions] = useState([])\n const [quantizationOptions, setQuantizationOptions] = useState([])\n const [customDeleted, setCustomDeleted] = useState(false)\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 const modelFamily = modelData.model_specs\n const formats = [...new Set(modelFamily.map((spec) => spec.model_format))]\n setFormatOptions(formats)\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 const launchModel = (url) => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n\n setIsCallingApi(true)\n\n const modelDataWithID = {\n // If user does not fill model_uid, pass null (None) to server and server generates it.\n model_type: 'multimodal',\n model_uid: modelUID.trim() === '' ? null : modelUID.trim(),\n model_name: modelData.model_name,\n model_format: modelFormat,\n model_size_in_billions: convertModelSize(modelSize),\n quantization: quantization,\n n_gpu:\n nGPU === '0' ? null : nGPU === 'auto' ? 'auto' : parseInt(nGPU, 10),\n }\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 window.open(url + '/ui/#/running_models', '_blank', 'noreferrer')\n }\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }\n\n const styles = {\n container: {\n display: 'block',\n position: 'relative',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n borderRadius: '20px',\n background: 'white',\n overflow: 'hidden',\n },\n containerSelected: {\n display: 'block',\n position: 'relative',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n borderRadius: '20px',\n background: 'white',\n overflow: 'hidden',\n boxShadow: '0 0 2px #00000099',\n },\n descriptionCard: {\n position: 'relative',\n top: '-1px',\n left: '-1px',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n padding: '20px',\n borderRadius: '20px',\n background: 'white',\n },\n parameterCard: {\n position: 'relative',\n top: `-${CARD_HEIGHT + 1}px`,\n left: '-1px',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n padding: '20px',\n borderRadius: '20px',\n background: 'white',\n },\n img: {\n display: 'block',\n margin: '0 auto',\n width: '180px',\n height: '180px',\n objectFit: 'cover',\n borderRadius: '10px',\n },\n h2: {\n margin: '10px 10px',\n fontSize: '20px',\n },\n p: {\n minHeight: '140px',\n fontSize: '14px',\n padding: '0px 10px 15px 10px',\n },\n buttonsContainer: {\n display: 'flex',\n margin: '0 auto',\n marginTop: '15px',\n border: 'none',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n buttonContainer: {\n width: '45%',\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '0px',\n },\n buttonItem: {\n width: '100%',\n margin: '0 auto',\n padding: '5px',\n display: 'flex',\n justifyContent: 'center',\n borderRadius: '4px',\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n },\n instructionText: {\n fontSize: '12px',\n color: '#666666',\n fontStyle: 'italic',\n margin: '10px 0',\n textAlign: 'center',\n },\n slideIn: {\n transform: 'translateX(0%)',\n transition: 'transform 0.2s ease-in-out',\n },\n slideOut: {\n transform: 'translateX(100%)',\n transition: 'transform 0.2s ease-in-out',\n },\n iconRow: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n iconItem: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n margin: '20px',\n },\n boldIconText: {\n fontWeight: 'bold',\n fontSize: '1.2em',\n },\n muiIcon: {\n fontSize: '1.5em',\n },\n smallText: {\n fontSize: '0.8em',\n },\n tagRow: {\n margin: '2px 5px',\n },\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(() => setCustomDeleted(true))\n .catch(console.error)\n }\n\n // Set two different states based on mouse hover\n return (\n <Box\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 >\n {/* First state: show description page */}\n <Box style={styles.descriptionCard}>\n {is_custom && (\n <Stack\n direction=\"row\"\n justifyContent=\"space-evenly\"\n alignItems=\"center\"\n spacing={1}\n >\n <Typography variant=\"h4\" gutterBottom noWrap>\n {modelData.model_name}\n </Typography>\n <IconButton\n aria-label=\"delete\"\n onClick={handeCustomDelete}\n disabled={customDeleted}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n )}\n {!is_custom && <h2 style={styles.h2}>{modelData.model_name}</h2>}\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 <Chip label={v} variant=\"outlined\" size=\"small\" />\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 <p style={styles.p}>{modelData.model_description}</p>\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 {/* Second state: show parameter selection page */}\n <Box\n style={\n selected\n ? { ...styles.parameterCard, ...styles.slideIn }\n : { ...styles.parameterCard, ...styles.slideOut }\n }\n >\n <h2 style={styles.h2}>{modelData.model_name}</h2>\n <Box display=\"flex\" flexDirection=\"column\" width=\"100%\" mx=\"auto\">\n <Grid container rowSpacing={0} columnSpacing={1}>\n <Grid item xs={6}>\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 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={6}>\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((spec) => spec.model_size_in_billions === size)\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={6}>\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat || !modelSize}\n >\n <InputLabel id=\"quantization-label\">Quantization</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 ? quant + ' (cached)' : 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={6}>\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 {['auto']\n .concat(\n range(\n 0,\n modelFormat !== 'pytorch' && modelFormat !== 'gptq'\n ? 1\n : gpuAvailable\n )\n )\n .map((v) => {\n return (\n <MenuItem key={v} value={v}>\n {v}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\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>\n </Box>\n <Box style={styles.buttonsContainer}>\n <button\n title=\"Launch\"\n style={styles.buttonContainer}\n onClick={() => launchModel(url, modelData)}\n disabled={\n isCallingApi ||\n isUpdatingModel ||\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== 'pytorch'))\n )\n }\n >\n {(() => {\n if (isCallingApi || isUpdatingModel) {\n return (\n <Box\n style={{ ...styles.buttonItem, backgroundColor: '#f2f2f2' }}\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={{ ...styles.buttonItem, backgroundColor: '#f2f2f2' }}\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 </Box>\n </Box>\n )\n}\n\nexport default MultimodalCard\n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M,CAAC4B,eAAgB,CAC9B6B,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAA7J,WAAW,CAAC,KAAK,CAAC,EAAC,CAAA8J,QAAA,cAElClL,IAAA,CAACnB,GAAG,EAACiM,KAAK,CAAEtD,MAAM,CAACiC,UAAW,CAAAyB,QAAA,cAC5BlL,IAAA,CAACrB,YAAY,EAACiL,KAAK,CAAC,SAAS,CAAC5E,IAAI,CAAC,MAAM,CAAE,CAAC,CACzC,CAAC,CACA,CAAC,EACN,CAAC,EACH,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAA3E,cAAc"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Tab}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import Title from'../../components/Title';import LaunchCustom from'./launchCustom';import LaunchEmbedding from'./launchEmbedding';import LaunchLLM from'./launchLLM';import LaunchMultimodal from'./launchMultimodal';import LaunchRerank from'./launchRerank';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchModel=function LaunchModel(){var endPoint=useContext(ApiContext).endPoint;var _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var _useState=useState(-1),_useState2=_slicedToArray(_useState,2),gpuAvailable=_useState2[0],setGPUAvailable=_useState2[1];var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);};useEffect(function(){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token==='need_auth'){navigate('/login',{replace:true});return;}if(gpuAvailable===-1){fetch(endPoint+'/v1/cluster/devices',{method:'GET',headers:{'Content-Type':'application/json'}}).then(function(res){if(!res.ok){// Usually, if some errors happen here, check if the cluster is available\nres.json().then(function(errorData){setErrorMsg(\"Server error: \".concat(res.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{res.json().then(function(data){setGPUAvailable(parseInt(data,10));});}});}},[cookie.token]);return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Launch Model\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:value,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:value,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Models\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Multimodal Models\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"3\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Models\",value:\"4\"}),/*#__PURE__*/_jsx(Tab,{label:\"Custom Models\",value:\"5\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"1\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchLLM,{gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchMultimodal,{gpuAvailable:gpuAvailable})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchEmbedding,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"4\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchRerank,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"5\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchCustom,{gpuAvailable:gpuAvailable})})]})]});};export default LaunchModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","Title","LaunchCustom","LaunchEmbedding","LaunchLLM","LaunchMultimodal","LaunchRerank","jsx","_jsx","jsxs","_jsxs","LaunchModel","endPoint","_React$useState","_React$useState2","_slicedToArray","value","setValue","_useState","_useState2","gpuAvailable","setGPUAvailable","_useContext","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","handleTabChange","event","newValue","token","undefined","replace","fetch","method","headers","then","res","ok","json","errorData","concat","status","detail","data","parseInt","m","children","title","sx","borderBottom","borderColor","onChange","label","padding"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Tab } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport Title from '../../components/Title'\nimport LaunchCustom from './launchCustom'\nimport LaunchEmbedding from './launchEmbedding'\nimport LaunchLLM from './launchLLM'\nimport LaunchMultimodal from './launchMultimodal'\nimport LaunchRerank from './launchRerank'\n\nconst LaunchModel = () => {\n let endPoint = useContext(ApiContext).endPoint\n const [value, setValue] = React.useState('1')\n const [gpuAvailable, setGPUAvailable] = useState(-1)\n\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n }\n\n useEffect(() => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token === 'need_auth') {\n navigate('/login', { replace: true })\n return\n }\n\n if (gpuAvailable === -1) {\n fetch(endPoint + '/v1/cluster/devices', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((res) => {\n if (!res.ok) {\n // Usually, if some errors happen here, check if the cluster is available\n res.json().then((errorData) => {\n setErrorMsg(\n `Server error: ${res.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n res.json().then((data) => {\n setGPUAvailable(parseInt(data, 10))\n })\n }\n })\n }\n }, [cookie.token])\n\n return (\n <Box m=\"20px\">\n <Title title=\"Launch Model\" />\n <ErrorMessageSnackBar />\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label=\"Language Models\" value=\"1\" />\n <Tab label=\"Multimodal Models\" value=\"2\" />\n <Tab label=\"Embedding Models\" value=\"3\" />\n <Tab label=\"Rerank Models\" value=\"4\" />\n <Tab label=\"Custom Models\" value=\"5\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <LaunchLLM gpuAvailable={gpuAvailable} />\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <LaunchMultimodal gpuAvailable={gpuAvailable} />\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <LaunchEmbedding />\n </TabPanel>\n <TabPanel value=\"4\" sx={{ padding: 0 }}>\n <LaunchRerank />\n </TabPanel>\n <TabPanel value=\"5\" sx={{ padding: 0 }}>\n <LaunchCustom gpuAvailable={gpuAvailable} />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default LaunchModel\n"],"mappings":"6IAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,GAAG,KAAQ,eAAe,CACxC,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,WAAW,KA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CAAE,CAAE,CAAAP,QAAA,cACrCxC,IAAA,CAACL,eAAe,GAAE,CAAC,CACX,CAAC,cACXK,IAAA,CAAClB,QAAQ,EAAC0B,KAAK,CAAC,GAAG,CAACkC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACrCxC,IAAA,CAACF,YAAY,GAAE,CAAC,CACR,CAAC,cACXE,IAAA,CAAClB,QAAQ,EAAC0B,KAAK,CAAC,GAAG,CAACkC,EAAE,CAAE,CAAEK,OAAO,CAAE,CAAE,CAAE,CAAAP,QAAA,cACrCxC,IAAA,CAACN,YAAY,EAACkB,YAAY,CAAEA,YAAa,CAAE,CAAC,CACpC,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAT,WAAW"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _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,TextField}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import MultimodalCard from'./multimodalCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchMultimodal=function LaunchMultimodal(_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 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():'';var modelDescription=registration.model_description?registration.model_description.toLowerCase():'';if(!modelName.includes(searchTerm.toLowerCase())&&!modelDescription.includes(searchTerm.toLowerCase())){return false;}return true;};var update=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,registrations,builtinRegistrations;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/multimodal?detailed=true\"),{method:'GET'});case 6:response=_context.sent;_context.next=9;return response.json();case 9:registrations=_context.sent;builtinRegistrations=registrations.filter(function(v){return v.is_builtin;});setRegistrationData(builtinRegistrations);_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().catch(console.error);},[]);var style={display:'grid',gridTemplateColumns:'repeat(auto-fill, minmax(300px, 1fr))',paddingLeft:'2rem',gridGap:'2rem 0rem'};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(TextField,{id:\"search\",type:\"search\",label:\"Search for model name and description\",value:searchTerm,onChange:handleChange,size:\"small\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){return/*#__PURE__*/_jsx(MultimodalCard,{url:endPoint,modelData:filteredRegistration,gpuAvailable:gpuAvailable});})})]});};export default LaunchMultimodal;","map":{"version":3,"names":["Box","FormControl","TextField","React","useContext","useEffect","useState","ApiContext","fetcher","MultimodalCard","jsx","_jsx","jsxs","_jsxs","LaunchMultimodal","_ref","gpuAvailable","endPoint","_useState","_useState2","_slicedToArray","registrationData","setRegistrationData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useState3","_useState4","searchTerm","setSearchTerm","handleChange","event","target","value","filter","registration","modelName","model_name","toLowerCase","modelDescription","model_description","includes","update","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","registrations","builtinRegistrations","wrap","_callee$","_context","prev","next","abrupt","concat","method","sent","json","v","is_builtin","t0","console","error","finish","stop","apply","arguments","catch","style","display","gridTemplateColumns","paddingLeft","gridGap","m","children","margin","variant","id","type","label","onChange","size","map","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchMultimodal.js"],"sourcesContent":["import { Box, FormControl, TextField } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport MultimodalCard from './multimodalCard'\n\nconst LaunchMultimodal = ({ 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\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 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 return true\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/multimodal?detailed=true`,\n {\n method: 'GET',\n }\n )\n\n const registrations = await response.json()\n const builtinRegistrations = registrations.filter((v) => v.is_builtin)\n\n setRegistrationData(builtinRegistrations)\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update().catch(console.error)\n }, [])\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: '1fr',\n margin: '30px 2rem',\n }}\n >\n <FormControl variant=\"outlined\" margin=\"normal\">\n <TextField\n id=\"search\"\n type=\"search\"\n label=\"Search for model name and description\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <MultimodalCard\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchMultimodal\n"],"mappings":"ubAAA,OAASA,GAAG,CAAEC,WAAW,CAAEC,SAAS,KAAQ,eAAe,CAC3D,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,cAAc,KAAM,kBAAkB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IA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AqB,CAChCxE,YAAY,CAAEA,YAAa,CAC5B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAF,gBAAgB"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,FormControl,InputLabel,MenuItem,Select,TextField}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 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===''||cookie.token===undefined||cookie.token==='need_auth')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(FormControl,{variant:\"outlined\",margin:\"normal\",children:/*#__PURE__*/_jsx(TextField,{id:\"search\",type:\"search\",label:\"Search for model name and description\",value:searchTerm,onChange:handleChange,size:\"small\"})})]}),/*#__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});})})]});};export default LaunchLLM;","map":{"version":3,"names":["Box","FormControl","InputLabel","MenuItem","Select","TextField","React","useContext","useEffect","useState","useCookies","ApiContext","fetcher","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","undefined","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","map","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchLLM.js"],"sourcesContent":["import {\n Box,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n} from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport 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 === '' ||\n cookie.token === undefined ||\n cookie.token === 'need_auth'\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 </Select>\n </FormControl>\n <FormControl variant=\"outlined\" margin=\"normal\">\n <TextField\n id=\"search\"\n type=\"search\"\n label=\"Search for model name and description\"\n value={searchTerm}\n onChange={handleChange}\n size=\"small\"\n />\n </FormControl>\n </div>\n <div style={style}>\n {registrationData\n .filter((registration) => filter(registration))\n .map((filteredRegistration) => (\n <ModelCard\n url={endPoint}\n modelData={filteredRegistration}\n gpuAvailable={gpuAvailable}\n />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchLLM\n"],"mappings":"6IAAA,OACEA,GAAG,CACHC,WAAW,CACXC,UAAU,CACVC,QAAQ,CACRC,MAAM,CACNC,SAAS,KACJ,eAAe,CACtB,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,SAAS,KAAM,aAAa,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEnC,GAAM,CAAAC,SAAS,CAAG,QAAZ,CAAAA,SAASA,CAAAC,IAAA,CAAyB,IAAnB,CAAAC,YAAY,CAAAD,IAAA,CAAZC,YAAY,CAC/B,GAAI,CAAAC,QAAQ,CAAGd,UAAU,CAACI,UAAU,CAAC,CAACU,QAAQ,CAC9C,IAAAC,WAAA,CAA0Cf,UAAU,CAACI,UAAU,CAAC,CAAxDY,YAAY,CAAAD,WAAA,CAAZC,YAAY,CAAEC,eAAe,CAAAF,WAAA,CAAfE,eAAe,CACrC,IAAAC,YAAA,CAA4BlB,UAAU,CAACI,UAAU,CAAC,CAA1Ce,eAAe,CAAAD,YAAA,CAAfC,eAAe,CACvB,IAAAC,YAAA,CAAwBpB,UAAU,CAACI,UAAU,CAAC,CAAtCiB,WAA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AK,CAAC,KAAK,CAAAoC,QAAA,CAAC,KAAG,CAAU,CAAC,cACpCrE,IAAA,CAACZ,QAAQ,EAAC6C,KAAK,CAAC,UAAU,CAAAoC,QAAA,CAAC,UAAQ,CAAU,CAAC,cAC9CrE,IAAA,CAACZ,QAAQ,EAAC6C,KAAK,CAAC,MAAM,CAAAoC,QAAA,CAAC,MAAI,CAAU,CAAC,EAChC,CAAC,EACE,CAAC,cACdrE,IAAA,CAACd,WAAW,EAACsF,OAAO,CAAC,UAAU,CAACD,MAAM,CAAC,QAAQ,CAAAF,QAAA,cAC7CrE,IAAA,CAACV,SAAS,EACRmF,EAAE,CAAC,QAAQ,CACXO,IAAI,CAAC,QAAQ,CACbL,KAAK,CAAC,uCAAuC,CAC7C1C,KAAK,CAAET,UAAW,CAClBoD,QAAQ,CAAE9C,YAAa,CACvB+C,IAAI,CAAC,OAAO,CACb,CAAC,CACS,CAAC,EACX,CAAC,cACN7E,IAAA,QAAK+D,KAAK,CAAEA,KAAM,CAAAM,QAAA,CACfjD,gBAAgB,CACde,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9C6C,GAAG,CAAC,SAACC,oBAAoB,qBACxBlF,IAAA,CAACF,SAAS,EACRqF,GAAG,CAAE7E,QAAS,CACd8E,SAAS,CAAEF,oBAAqB,CAChC7E,YAAY,CAAEA,YAAa,CAC5B,CAAC,EACH,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAF,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Checkbox,FormControl,FormControlLabel,FormHelperText,Radio,RadioGroup,Tab}from'@mui/material';import Alert from'@mui/material/Alert';import AlertTitle from'@mui/material/AlertTitle';import Button from'@mui/material/Button';import TextField from'@mui/material/TextField';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetcher from'../../components/fetcher';import Title from'../../components/Title';import{useMode}from'../../theme';import RegisterEmbeddingModel from'./register_embedding';import RegisterRerankModel from'./register_rerank';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:'English',zh:'Chinese'};var SUPPORTED_FEATURES=['Generate','Chat'];// Convert dictionary of supported languages into list\nvar SUPPORTED_LANGUAGES=Object.keys(SUPPORTED_LANGUAGES_DICT);var RegisterModel=function RegisterModel(){var ERROR_COLOR=useMode();var endPoint=useContext(ApiContext).endPoint;var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),successMsg=_useState2[0],setSuccessMsg=_useState2[1];var _useState3=useState('pytorch'),_useState4=_slicedToArray(_useState3,2),modelFormat=_useState4[0],setModelFormat=_useState4[1];var _useState5=useState(7),_useState6=_slicedToArray(_useState5,2),modelSize=_useState6[0],setModelSize=_useState6[1];var _useState7=useState('/path/to/llama-2'),_useState8=_slicedToArray(_useState7,2),modelUri=_useState8[0],setModelUri=_useState8[1];var _useState9=useState({version:1,context_length:2048,model_name:'custom-llama-2',model_lang:['en'],model_ability:['generate'],model_description:'This is a custom model description.',model_family:'',model_specs:[],prompt_style:undefined}),_useState10=_slicedToArray(_useState9,2),formData=_useState10[0],setFormData=_useState10[1];var _useState11=useState([]),_useState12=_slicedToArray(_useState11,2),promptStyles=_useState12[0],setPromptStyles=_useState12[1];var _useState13=useState({chat:[],generate:[]}),_useState14=_slicedToArray(_useState13,2),family=_useState14[0],setFamily=_useState14[1];var _useState15=useState(''),_useState16=_slicedToArray(_useState15,2),familyLabel=_useState16[0],setFamilyLabel=_useState16[1];var _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var errorModelName=formData.model_name.trim().length<=0;var errorModelDescription=formData.model_description.length<0;var errorContextLength=formData.context_length===0;var errorLanguage=formData.model_lang===undefined||formData.model_lang.length===0;var errorAbility=formData.model_ability===undefined||formData.model_ability.length===0;var errorModelSize=formData.model_specs&&formData.model_specs.some(function(spec){return spec.model_size_in_billions===undefined||spec.model_size_in_billions===0;});var errorFamily=familyLabel==='';var errorAny=errorModelName||errorModelDescription||errorContextLength||errorLanguage||errorAbility||errorModelSize||errorFamily;useEffect(function(){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token==='need_auth'){navigate('/login',{replace:true});return;}var getBuiltinFamilies=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,errorData,data;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(endPoint+'/v1/models/families',{method:'GET',headers:{'Content-Type':'application/json'}});case 2:response=_context.sent;if(response.ok){_context.next=10;break;}_context.next=6;return response.json();case 6:errorData=_context.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context.next=16;break;case 10:_context.next=12;return response.json();case 12:data=_context.sent;data.chat.push('other');data.generate.push('other');setFamily(data);case 16:case\"end\":return _context.stop();}},_callee);}));return function getBuiltinFamilies(){return _ref.apply(this,arguments);};}();var getBuiltInPromptStyles=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var response,errorData,data,res,key,v;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return fetch(endPoint+'/v1/models/prompts',{method:'GET',headers:{'Content-Type':'application/json'}});case 2:response=_context2.sent;if(response.ok){_context2.next=10;break;}_context2.next=6;return response.json();case 6:errorData=_context2.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context2.next=16;break;case 10:_context2.next=12;return response.json();case 12:data=_context2.sent;res=[];for(key in data){v=data[key];v['name']=key;res.push(v);}setPromptStyles(res);case 16:case\"end\":return _context2.stop();}},_callee2);}));return function getBuiltInPromptStyles(){return _ref2.apply(this,arguments);};}();// avoid keep requesting backend to get prompts\nif(promptStyles.length===0){getBuiltInPromptStyles().catch(function(error){setErrorMsg(error.message||'An unexpected error occurred when getting builtin prompt styles.');console.error('Error: ',error);});}if(family.chat.length===0){getBuiltinFamilies().catch(function(error){setErrorMsg(error.message||'An unexpected error occurred when getting builtin prompt styles.');console.error('Error: ',error);});}},[cookie.token]);var getFamilyByAbility=function getFamilyByAbility(){if(formData.model_ability.includes('chat')){return family.chat;}else{return family.generate;}};var isModelFormatPytorch=function isModelFormatPytorch(){return modelFormat==='pytorch';};var isModelFormatGPTQ=function isModelFormatGPTQ(){return modelFormat==='gptq';};var getPathComponents=function getPathComponents(path){var normalizedPath=path.replace(/\\\\/g,'/');var baseDir=normalizedPath.substring(0,normalizedPath.lastIndexOf('/'));var filename=normalizedPath.substring(normalizedPath.lastIndexOf('/')+1);return{baseDir:baseDir,filename:filename};};var handleClick=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _getPathComponents,baseDir,filename,ps,_ps$stop,_ps$stop_token_ids,response,errorData;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(isModelFormatGPTQ()){formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[''],model_id:'',model_uri:modelUri}];}else if(!isModelFormatPytorch()){_getPathComponents=getPathComponents(modelUri),baseDir=_getPathComponents.baseDir,filename=_getPathComponents.filename;formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[''],model_id:'',model_file_name_template:filename,model_uri:baseDir}];}else{formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:['4-bit','8-bit','none'],model_id:'',model_uri:modelUri}];}formData.model_family=familyLabel;if(formData.model_ability.includes('chat')){ps=promptStyles.find(function(item){return item.name===familyLabel;});if(ps){formData.prompt_style={style_name:ps.style_name,system_prompt:ps.system_prompt,roles:ps.roles,intra_message_sep:ps.intra_message_sep,inter_message_sep:ps.inter_message_sep,stop:(_ps$stop=ps.stop)!==null&&_ps$stop!==void 0?_ps$stop:null,stop_token_ids:(_ps$stop_token_ids=ps.stop_token_ids)!==null&&_ps$stop_token_ids!==void 0?_ps$stop_token_ids:null};}}if(!errorAny){_context3.next=6;break;}setErrorMsg('Please fill in valid value for all fields');return _context3.abrupt(\"return\");case 6:_context3.prev=6;_context3.next=9;return fetcher(endPoint+'/v1/model_registrations/LLM',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 9:response=_context3.sent;if(response.ok){_context3.next=17;break;}_context3.next=13;return response.json();case 13:errorData=_context3.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context3.next=18;break;case 17:setSuccessMsg('Model has been registered successfully! Navigate to launch model page to proceed.');case 18:_context3.next=24;break;case 20:_context3.prev=20;_context3.t0=_context3[\"catch\"](6);console.error('There was a problem with the fetch operation:',_context3.t0);setErrorMsg(_context3.t0.message||'An unexpected error occurred.');case 24:case\"end\":return _context3.stop();}},_callee3,null,[[6,20]]);}));return function handleClick(){return _ref3.apply(this,arguments);};}();var toggleLanguage=function toggleLanguage(lang){if(formData.model_lang.includes(lang)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:formData.model_lang.filter(function(l){return l!==lang;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:[].concat(_toConsumableArray(formData.model_lang),[lang])}));}};var toggleAbility=function toggleAbility(ability){setFamilyLabel('');if(formData.model_ability.includes(ability)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:formData.model_ability.filter(function(a){return a!==ability;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:[].concat(_toConsumableArray(formData.model_ability),[ability])}));}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Register Model\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:tabValue,onChange:function onChange(e,v){setTabValue(v);},\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Model\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Model\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Model\",value:\"3\"})]})}),/*#__PURE__*/_jsxs(TabPanel,{value:\"1\",sx:{padding:0},children:[/*#__PURE__*/_jsx(Box,{padding:\"20px\"}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(TextField,{label:\"Model Name\",error:errorModelName,defaultValue:formData.model_name,size:\"small\",helperText:\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_name:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5},children:\"Model Format\"}),/*#__PURE__*/_jsx(RadioGroup,{value:modelFormat,onChange:function onChange(e){setModelFormat(e.target.value);},children:/*#__PURE__*/_jsxs(Box,{sx:styles.checkboxWrapper,children:[/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"pytorch\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"PyTorch\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggmlv3\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGML\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggufv2\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGUF\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"gptq\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GPTQ\"})})]})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:errorContextLength,label:\"Context Length\",value:formData.context_length,size:\"small\",onChange:function onChange(event){var value=event.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,'')||'0';}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value='0';}// Update with the processed value\nsetFormData(_objectSpread(_objectSpread({},formData),{},{context_length:Number(value)}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Size in Billions\",size:\"small\",error:errorModelSize,value:modelSize,onChange:function onChange(e){var value=e.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,'')||'0';}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value='0';}setModelSize(Number(value));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Path\",size:\"small\",value:modelUri,onChange:function onChange(e){setModelUri(e.target.value);},helperText:\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Description (Optional)\",error:errorModelDescription,defaultValue:formData.model_description,size:\"small\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_description:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorLanguage?ERROR_COLOR:'inherit'},children:\"Model Languages\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_LANGUAGES.map(function(lang){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_lang.includes(lang),onChange:function onChange(){return toggleLanguage(lang);},name:lang,sx:errorLanguage?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:SUPPORTED_LANGUAGES_DICT[lang],style:{paddingLeft:10,color:errorLanguage?ERROR_COLOR:'inherit'}})},lang);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Model Abilities\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_FEATURES.map(function(ability){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_ability.includes(ability.toLowerCase()),onChange:function onChange(){return toggleAbility(ability.toLowerCase());},name:ability,sx:errorAbility?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:ability,style:{paddingLeft:10,color:errorAbility?ERROR_COLOR:'inherit'}})},ability);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Model Family\"}),/*#__PURE__*/_jsx(FormHelperText,{children:\"Please be careful to select the family name corresponding to the model you want to register. If not found, please choose `other`.\"}),/*#__PURE__*/_jsx(RadioGroup,{value:familyLabel,onChange:function onChange(e){setFamilyLabel(e.target.value);},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:getFamilyByAbility().map(function(v){return/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:v,control:/*#__PURE__*/_jsx(Radio,{}),label:v})});})})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(Box,{width:'100%',children:[successMsg!==''&&/*#__PURE__*/_jsxs(Alert,{severity:\"success\",children:[/*#__PURE__*/_jsx(AlertTitle,{children:\"Success\"}),successMsg]}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterEmbeddingModel,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterRerankModel,{})})]})]});};export default RegisterModel;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',maxWidth:'80%'},labelPaddingLeft:{paddingLeft:5},formControlLabelPaddingLeft:{paddingLeft:10},buttonBox:{width:'100%',margin:'20px'},error:{fontWeight:'bold',margin:'5px 0',padding:'1px',borderRadius:'5px'}};","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Checkbox","FormControl","FormControlLabel","FormHelperText","Radio","RadioGroup","Tab","Alert","AlertTitle","Button","TextField","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","fetcher","Title","useMode","RegisterEmbeddingModel","RegisterRerankModel","jsx","_jsx","jsxs","_jsxs","SUPPORTED_LANGUAGES_DICT","en","zh","SUPPORTED_FEATURES","SUPPORTED_LANGUAGES","Object","keys","RegisterModel","ERROR_COLOR","endPoint","_useContext","setErrorMsg","_useState","_useState2","_slicedToArray","successMsg","setSuccessMsg","_useState3","_useState4","modelFormat","setModelFormat","_useState5","_useState6","modelSize","setModelSize","_useState7","_useState8","modelUri","setModelUri","_useState9","version","context_length","model_name","model_lang","model_ability","model_description","model_family","model_specs","prompt_style","undefined","_useState10","formData","setFormData","_useState11","_useState12","promptStyles","setPromptStyles","_useState13","chat","generate","_useState14","family","setFamily","_useState15","_useState16","familyLabel","setFamilyLabel","_React$useState","_React$useState2","tabValue","setTabValue","_useCookies","_useCookies2","cookie","navigate","errorModelName","trim","length","errorModelDescription","errorContextLength","errorLanguage","errorAbility","errorModelSize","some","spec","model_size_in_billions","errorFamily","errorAny","token","replace","getBuiltinFamilies","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","errorData","data","wrap","_callee$","_context","prev","next","fetch","method","headers","sent","ok","json","concat","status","detail","push","stop","apply","arguments","getBuiltInPromptStyles","_ref2","_callee2","res","key","v","_callee2$","_context2","catch","error","message","console","getFamilyByAbility","includes","isModelFormatPytorch","isModelFormatGPTQ","getPathComponents","path","normalizedPath","baseDir","substring","lastIndexOf","filename","handleClick","_ref3","_callee3","_getPathComponents","ps","_ps$stop","_ps$stop_token_ids","_callee3$","_context3","model_format","quantizations","model_id","model_uri","model_file_name_template","find","item","name","style_name","system_prompt","roles","intra_message_sep","inter_message_sep","stop_token_ids","abrupt","body","JSON","stringify","model","persist","t0","toggleLanguage","lang","_objectSpread","filter","l","_toConsumableArray","toggleAbility","ability","a","m","children","title","value","sx","borderBottom","borderColor","onChange","e","label","padding","styles","baseFormControl","defaultValue","size","helperText","event","target","style","paddingLeft","checkboxWrapper","marginLeft","control","test","parseInt","Number","color","map","marginRight","checked","toLowerCase","width","severity","variant","type","onClick","margin","display","flexWrap","maxWidth","labelPaddingLeft","formControlLabelPaddingLeft","buttonBox","fontWeight","borderRadius"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport {\n Box,\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText,\n Radio,\n RadioGroup,\n Tab,\n} from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport AlertTitle from '@mui/material/AlertTitle'\nimport Button from '@mui/material/Button'\nimport TextField from '@mui/material/TextField'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetcher from '../../components/fetcher'\nimport Title from '../../components/Title'\nimport { useMode } from '../../theme'\nimport RegisterEmbeddingModel from './register_embedding'\nimport RegisterRerankModel from './register_rerank'\n\nconst SUPPORTED_LANGUAGES_DICT = { en: 'English', zh: 'Chinese' }\nconst SUPPORTED_FEATURES = ['Generate', 'Chat']\n\n// Convert dictionary of supported languages into list\nconst SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT)\n\nconst RegisterModel = () => {\n const ERROR_COLOR = useMode()\n const endPoint = useContext(ApiContext).endPoint\n const { setErrorMsg } = useContext(ApiContext)\n const [successMsg, setSuccessMsg] = useState('')\n const [modelFormat, setModelFormat] = useState('pytorch')\n const [modelSize, setModelSize] = useState(7)\n const [modelUri, setModelUri] = useState('/path/to/llama-2')\n const [formData, setFormData] = useState({\n version: 1,\n context_length: 2048,\n model_name: 'custom-llama-2',\n model_lang: ['en'],\n model_ability: ['generate'],\n model_description: 'This is a custom model description.',\n model_family: '',\n model_specs: [],\n prompt_style: undefined,\n })\n const [promptStyles, setPromptStyles] = useState([])\n const [family, setFamily] = useState({\n chat: [],\n generate: [],\n })\n const [familyLabel, setFamilyLabel] = useState('')\n const [tabValue, setTabValue] = React.useState('1')\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n\n const errorModelName = formData.model_name.trim().length <= 0\n const errorModelDescription = formData.model_description.length < 0\n const errorContextLength = formData.context_length === 0\n const errorLanguage =\n formData.model_lang === undefined || formData.model_lang.length === 0\n const errorAbility =\n formData.model_ability === undefined || formData.model_ability.length === 0\n const errorModelSize =\n formData.model_specs &&\n formData.model_specs.some((spec) => {\n return (\n spec.model_size_in_billions === undefined ||\n spec.model_size_in_billions === 0\n )\n })\n const errorFamily = familyLabel === ''\n const errorAny =\n errorModelName ||\n errorModelDescription ||\n errorContextLength ||\n errorLanguage ||\n errorAbility ||\n errorModelSize ||\n errorFamily\n\n useEffect(() => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token === 'need_auth') {\n navigate('/login', { replace: true })\n return\n }\n\n const getBuiltinFamilies = async () => {\n const response = await fetch(endPoint + '/v1/models/families', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n const data = await response.json()\n data.chat.push('other')\n data.generate.push('other')\n setFamily(data)\n }\n }\n\n const getBuiltInPromptStyles = async () => {\n const response = await fetch(endPoint + '/v1/models/prompts', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n const data = await response.json()\n let res = []\n for (const key in data) {\n let v = data[key]\n v['name'] = key\n res.push(v)\n }\n setPromptStyles(res)\n }\n }\n // avoid keep requesting backend to get prompts\n if (promptStyles.length === 0) {\n getBuiltInPromptStyles().catch((error) => {\n setErrorMsg(\n error.message ||\n 'An unexpected error occurred when getting builtin prompt styles.'\n )\n console.error('Error: ', error)\n })\n }\n if (family.chat.length === 0) {\n getBuiltinFamilies().catch((error) => {\n setErrorMsg(\n error.message ||\n 'An unexpected error occurred when getting builtin prompt styles.'\n )\n console.error('Error: ', error)\n })\n }\n }, [cookie.token])\n\n const getFamilyByAbility = () => {\n if (formData.model_ability.includes('chat')) {\n return family.chat\n } else {\n return family.generate\n }\n }\n\n const isModelFormatPytorch = () => {\n return modelFormat === 'pytorch'\n }\n\n const isModelFormatGPTQ = () => {\n return modelFormat === 'gptq'\n }\n\n const getPathComponents = (path) => {\n const normalizedPath = path.replace(/\\\\/g, '/')\n const baseDir = normalizedPath.substring(0, normalizedPath.lastIndexOf('/'))\n const filename = normalizedPath.substring(\n normalizedPath.lastIndexOf('/') + 1\n )\n return { baseDir, filename }\n }\n\n const handleClick = async () => {\n if (isModelFormatGPTQ()) {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [''],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n } else if (!isModelFormatPytorch()) {\n const { baseDir, filename } = getPathComponents(modelUri)\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [''],\n model_id: '',\n model_file_name_template: filename,\n model_uri: baseDir,\n },\n ]\n } else {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: ['4-bit', '8-bit', 'none'],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n }\n\n formData.model_family = familyLabel\n\n if (formData.model_ability.includes('chat')) {\n const ps = promptStyles.find((item) => item.name === familyLabel)\n if (ps) {\n formData.prompt_style = {\n style_name: ps.style_name,\n system_prompt: ps.system_prompt,\n roles: ps.roles,\n intra_message_sep: ps.intra_message_sep,\n inter_message_sep: ps.inter_message_sep,\n stop: ps.stop ?? null,\n stop_token_ids: ps.stop_token_ids ?? null,\n }\n }\n }\n\n if (errorAny) {\n setErrorMsg('Please fill in valid value for all fields')\n return\n }\n\n try {\n const response = await fetcher(endPoint + '/v1/model_registrations/LLM', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: JSON.stringify(formData),\n persist: true,\n }),\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n setSuccessMsg(\n 'Model has been registered successfully! Navigate to launch model page to proceed.'\n )\n }\n } catch (error) {\n console.error('There was a problem with the fetch operation:', error)\n setErrorMsg(error.message || 'An unexpected error occurred.')\n }\n }\n\n const toggleLanguage = (lang) => {\n if (formData.model_lang.includes(lang)) {\n setFormData({\n ...formData,\n model_lang: formData.model_lang.filter((l) => l !== lang),\n })\n } else {\n setFormData({\n ...formData,\n model_lang: [...formData.model_lang, lang],\n })\n }\n }\n\n const toggleAbility = (ability) => {\n setFamilyLabel('')\n if (formData.model_ability.includes(ability)) {\n setFormData({\n ...formData,\n model_ability: formData.model_ability.filter((a) => a !== ability),\n })\n } else {\n setFormData({\n ...formData,\n model_ability: [...formData.model_ability, ability],\n })\n }\n }\n\n return (\n <Box m=\"20px\">\n <Title title=\"Register Model\" />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={(e, v) => {\n setTabValue(v)\n }}\n aria-label=\"tabs\"\n >\n <Tab label=\"Language Model\" value=\"1\" />\n <Tab label=\"Embedding Model\" value=\"2\" />\n <Tab label=\"Rerank Model\" value=\"3\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <Box padding=\"20px\"></Box>\n {/* Base Information */}\n <FormControl sx={styles.baseFormControl}>\n <TextField\n label=\"Model Name\"\n error={errorModelName}\n defaultValue={formData.model_name}\n size=\"small\"\n helperText=\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\"\n onChange={(event) =>\n setFormData({ ...formData, model_name: event.target.value })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n }}\n >\n Model Format\n </label>\n\n <RadioGroup\n value={modelFormat}\n onChange={(e) => {\n setModelFormat(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"pytorch\"\n control={<Radio />}\n label=\"PyTorch\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"ggmlv3\"\n control={<Radio />}\n label=\"GGML\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"ggufv2\"\n control={<Radio />}\n label=\"GGUF\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"gptq\"\n control={<Radio />}\n label=\"GPTQ\"\n />\n </Box>\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={errorContextLength}\n label=\"Context Length\"\n value={formData.context_length}\n size=\"small\"\n onChange={(event) => {\n let value = event.target.value\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, '') || '0'\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = '0'\n }\n // Update with the processed value\n setFormData({\n ...formData,\n context_length: Number(value),\n })\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Size in Billions\"\n size=\"small\"\n error={errorModelSize}\n value={modelSize}\n onChange={(e) => {\n let value = e.target.value\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, '') || '0'\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = '0'\n }\n setModelSize(Number(value))\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Path\"\n size=\"small\"\n value={modelUri}\n onChange={(e) => {\n setModelUri(e.target.value)\n }}\n helperText=\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Description (Optional)\"\n error={errorModelDescription}\n defaultValue={formData.model_description}\n size=\"small\"\n onChange={(event) =>\n setFormData({\n ...formData,\n model_description: event.target.value,\n })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Languages\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_LANGUAGES.map((lang) => (\n <Box key={lang} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_lang.includes(lang)}\n onChange={() => toggleLanguage(lang)}\n name={lang}\n sx={\n errorLanguage\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={SUPPORTED_LANGUAGES_DICT[lang]}\n style={{\n paddingLeft: 10,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Abilities\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_FEATURES.map((ability) => (\n <Box key={ability} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_ability.includes(\n ability.toLowerCase()\n )}\n onChange={() => toggleAbility(ability.toLowerCase())}\n name={ability}\n sx={\n errorAbility\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={ability}\n style={{\n paddingLeft: 10,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <FormControl sx={styles.baseFormControl}>\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Family\n </label>\n <FormHelperText>\n Please be careful to select the family name corresponding to the\n model you want to register. If not found, please choose `other`.\n </FormHelperText>\n <RadioGroup\n value={familyLabel}\n onChange={(e) => {\n setFamilyLabel(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n {getFamilyByAbility().map((v) => (\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel value={v} control={<Radio />} label={v} />\n </Box>\n ))}\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <Box width={'100%'}>\n {successMsg !== '' && (\n <Alert severity=\"success\">\n <AlertTitle>Success</AlertTitle>\n {successMsg}\n </Alert>\n )}\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleClick}\n >\n Register Model\n </Button>\n </Box>\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <RegisterEmbeddingModel />\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <RegisterRerankModel />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RegisterModel\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n maxWidth: '80%',\n },\n labelPaddingLeft: {\n paddingLeft: 5,\n },\n formControlLabelPaddingLeft: {\n paddingLeft: 10,\n },\n buttonBox: {\n width: '100%',\n margin: '20px',\n },\n error: {\n fontWeight: 'bold',\n margin: '5px 0',\n padding: '1px',\n borderRadius: '5px',\n },\n}\n"],"mappings":"wtBAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OACEC,GAAG,CACHC,QAAQ,CACRC,WAAW,CACXC,gBAAgB,CAChBC,cAAc,CACdC,KAAK,CACLC,UAAU,CACVC,GAAG,KACE,eAAe,CACtB,MAAO,CAAAC,KAAK,KAAM,qBAAqB,CACvC,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,MAAM,KAAM,sBAAsB,CACzC,MAAO,CAAAC,SAAS,KAAM,yBAAyB,CAC/C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,OAASC,OAAO,KAAQ,aAAa,CACrC,MAAO,CAAAC,sBAAsB,KAAM,sBAAsB,CACzD,MAAO,CAAAC,mBAAmB,KAAM,mBAAmB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAEnD,GAAM,CAAAC,wBAAwB,CAAG,CAAEC,EAAE,CAAE,SAAS,CAAEC,EAAE,CAAE,SAAU,CAAC,CACjE,GAAM,CAAAC,kBAAkB,CAAG,CAAC,UAAU,CAAE,MAAM,CAAC,CAE/C;AACA,GAAM,CAAAC,mBAAmB,CAAGC,M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