xinference 0.7.0__py3-none-any.whl → 0.7.1__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (46) hide show
  1. xinference/_version.py +3 -3
  2. xinference/api/restful_api.py +4 -4
  3. xinference/deploy/utils.py +3 -1
  4. xinference/model/embedding/__init__.py +5 -1
  5. xinference/model/embedding/core.py +7 -7
  6. xinference/model/llm/ggml/chatglm.py +7 -5
  7. xinference/model/llm/llm_family.py +41 -15
  8. xinference/model/llm/pytorch/core.py +1 -0
  9. xinference/model/llm/pytorch/utils.py +3 -0
  10. xinference/model/llm/vllm/core.py +5 -1
  11. xinference/model/rerank/__init__.py +5 -1
  12. xinference/model/rerank/core.py +7 -6
  13. xinference/model/utils.py +13 -2
  14. xinference/web/ui/build/asset-manifest.json +3 -3
  15. xinference/web/ui/build/index.html +1 -1
  16. xinference/web/ui/build/static/js/main.778615cc.js +3 -0
  17. xinference/web/ui/build/static/js/main.778615cc.js.map +1 -0
  18. xinference/web/ui/node_modules/.cache/babel-loader/35204b265d70210394b0a8571e5b01c8c0f9a748437b8a923961e3560ae3d550.json +1 -0
  19. xinference/web/ui/node_modules/.cache/babel-loader/483eb7e5f01e34c6a42ad7c64dad550ff945ee21053a52c2e5e7ebe108b85411.json +1 -0
  20. xinference/web/ui/node_modules/.cache/babel-loader/667753ce39ce1d4bcbf9a5f1a103d653be1d19d42f4e1fbaceb9b507679a52c7.json +1 -0
  21. xinference/web/ui/node_modules/.cache/babel-loader/6e63957e4e0801705c6cb258379bfda0007ce6c3ddd2e3b62898b68455c3edf4.json +1 -0
  22. xinference/web/ui/node_modules/.cache/babel-loader/8d2b0b3c6988d1894694dcbbe708ef91cfe62d62dac317031f09915ced637953.json +1 -0
  23. xinference/web/ui/node_modules/.cache/babel-loader/8d77975a2735d67a618407026e5325608ccd66f1b379a74faf35b4087db536f3.json +1 -0
  24. xinference/web/ui/node_modules/.cache/babel-loader/b374bf2be1eac3cff5e0a8528a8e816e266ece911f714c123110961798a93a3b.json +1 -0
  25. xinference/web/ui/node_modules/.cache/babel-loader/d8a42e9df7157de9f28eecefdf178fd113bf2280d28471b6e32a8a45276042df.json +1 -0
  26. xinference/web/ui/node_modules/.cache/babel-loader/ed010102f476cd1a22b49be031a7f94f2ab3dd7ba8bf58839a771d46e28ff559.json +1 -0
  27. xinference/web/ui/node_modules/.cache/babel-loader/fe653ca0ca4297b415c0be4013574870d0465a657ae0f3d3f5b66ef6a831390c.json +1 -0
  28. {xinference-0.7.0.dist-info → xinference-0.7.1.dist-info}/METADATA +1 -1
  29. {xinference-0.7.0.dist-info → xinference-0.7.1.dist-info}/RECORD +34 -34
  30. xinference/web/ui/build/static/js/main.8126d441.js +0 -3
  31. xinference/web/ui/build/static/js/main.8126d441.js.map +0 -1
  32. xinference/web/ui/node_modules/.cache/babel-loader/06eb9846159adb398d44df0b0debc256a9fd9e8171a7d68f5c4ee4d655acfa45.json +0 -1
  33. xinference/web/ui/node_modules/.cache/babel-loader/3bda436576ecb05f81f7b6ec475d1cfaf03e2b3066e3a75902fe6e8c4773b43b.json +0 -1
  34. xinference/web/ui/node_modules/.cache/babel-loader/48878f5178bad1a47757e011af41c974a7946efa29485506c4d19f25bf5d522d.json +0 -1
  35. xinference/web/ui/node_modules/.cache/babel-loader/59574eb63cfe9ed2e58d2f5a420e1ae54354e243a602e9bc73deae3147ed4f98.json +0 -1
  36. xinference/web/ui/node_modules/.cache/babel-loader/75a5abcbc92da335fdde530f5689194ec79a4b2345b8cba594f8904d3b88e3c6.json +0 -1
  37. xinference/web/ui/node_modules/.cache/babel-loader/84bfe7afede38da1f8ad569d891276fe4d66cfb87bf5c9ff7a113788ba62bb88.json +0 -1
  38. xinference/web/ui/node_modules/.cache/babel-loader/940ed05006583b955894e2b8f65a4a5ebf34f8149d747f59fae5131f17d65482.json +0 -1
  39. xinference/web/ui/node_modules/.cache/babel-loader/9c5f03db9aa88582a9b69b25c7f1acc78ba7fc61f743c9ed7399abb292d5dbde.json +0 -1
  40. xinference/web/ui/node_modules/.cache/babel-loader/c02e70e9b9efcf3bd056606308104308d6a6ac559f2bc0b4454c11fb5874457c.json +0 -1
  41. xinference/web/ui/node_modules/.cache/babel-loader/e610aefd7000a3f8542a25cb66c64671cc8da18350de4e5b577102ba4bb78d65.json +0 -1
  42. /xinference/web/ui/build/static/js/{main.8126d441.js.LICENSE.txt → main.778615cc.js.LICENSE.txt} +0 -0
  43. {xinference-0.7.0.dist-info → xinference-0.7.1.dist-info}/LICENSE +0 -0
  44. {xinference-0.7.0.dist-info → xinference-0.7.1.dist-info}/WHEEL +0 -0
  45. {xinference-0.7.0.dist-info → xinference-0.7.1.dist-info}/entry_points.txt +0 -0
  46. {xinference-0.7.0.dist-info → xinference-0.7.1.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,FormControl,TextField}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import RerankCard from'./rerankCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchRerank=function LaunchRerank(){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():'';return modelName.includes(searchTerm.toLowerCase());};var update=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var response,registrations,newRegistrationData;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context2.next=2;break;}return _context2.abrupt(\"return\");case 2:_context2.prev=2;setIsCallingApi(true);_context2.next=6;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/rerank\"),{method:'GET'});case 6:response=_context2.sent;_context2.next=9;return response.json();case 9:registrations=_context2.sent;_context2.next=12;return Promise.all(registrations.map(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/rerank/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context.sent;_context.t0=_objectSpread;_context.t1=_objectSpread;_context.t2={};_context.next=8;return desc.json();case 8:_context.t3=_context.sent;_context.t4=(0,_context.t1)(_context.t2,_context.t3);_context.t5={};_context.t6={is_builtin:registration.is_builtin};return _context.abrupt(\"return\",(0,_context.t0)(_context.t4,_context.t5,_context.t6));case 13:case\"end\":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}()));case 12:newRegistrationData=_context2.sent;setRegistrationData(newRegistrationData);_context2.next=19;break;case 16:_context2.prev=16;_context2.t0=_context2[\"catch\"](2);console.error('Error:',_context2.t0);case 19:_context2.prev=19;setIsCallingApi(false);return _context2.finish(19);case 22:case\"end\":return _context2.stop();}},_callee2,null,[[2,16,19,22]]);}));return function update(){return _ref.apply(this,arguments);};}();useEffect(function(){update();// eslint-disable-next-line\n},[]);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 rerank model name\",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(RerankCard,{url:endPoint,modelData:filteredRegistration});})})]});};export default LaunchRerank;","map":{"version":3,"names":["Box","FormControl","TextField","React","useContext","useEffect","useState","ApiContext","RerankCard","jsx","_jsx","jsxs","_jsxs","LaunchRerank","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","includes","update","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee2","response","registrations","newRegistrationData","wrap","_callee2$","_context2","prev","next","abrupt","fetch","concat","method","sent","json","Promise","all","map","_ref2","_callee","desc","_callee$","_context","t0","_objectSpread","t1","t2","t3","t4","t5","t6","is_builtin","stop","_x","apply","arguments","console","error","finish","style","display","gridTemplateColumns","paddingLeft","gridGap","m","children","margin","variant","id","type","label","onChange","size","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchRerank.js"],"sourcesContent":["import { Box, FormControl, TextField } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport RerankCard from './rerankCard'\n\nconst LaunchRerank = () => {\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 return modelName.includes(searchTerm.toLowerCase())\n }\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return\n\n try {\n setIsCallingApi(true)\n\n const response = await fetch(\n `${endPoint}/v1/model_registrations/rerank`,\n {\n method: 'GET',\n }\n )\n\n const registrations = await response.json()\n const newRegistrationData = await Promise.all(\n registrations.map(async (registration) => {\n const desc = await fetch(\n `${endPoint}/v1/model_registrations/rerank/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n setRegistrationData(newRegistrationData)\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n // eslint-disable-next-line\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 rerank model name\"\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 <RerankCard url={endPoint} modelData={filteredRegistration} />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchRerank\n"],"mappings":"mkBAAA,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,UAAU,KAAM,cAAc,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAErC,GAAM,CAAAC,YAAY,CAAG,QAAf,CAAAA,YAAYA,CAAA,CAAS,CACzB,GAAI,CAAAC,QAAQ,CAAGV,UAAU,CAACG,UAAU,CAAC,CAACO,QAAQ,CAC9C,IAAAC,SAAA,CAAgDT,QAAQ,CAAC,EAAE,CAAC,CAAAU,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAArDG,gBAAgB,CAAAF,UAAA,IAAEG,mBAAmB,CAAAH,UAAA,IAC5C,IAAAI,WAAA,CAA0ChB,UAAU,CAACG,UAAU,CAAC,CAAxDc,YAAY,CAAAD,WAAA,CAAZC,YAAY,CAAEC,eAAe,CAAAF,WAAA,CAAfE,eAAe,CACrC,IAAAC,YAAA,CAA4BnB,UAAU,CAACG,UAAU,CAAC,CAA1CiB,eAAe,CAAAD,YAAA,CAAfC,eAAe,CAEvB;AACA,IAAAC,UAAA,CAAoCnB,QAAQ,CAAC,EAAE,CAAC,CAAAoB,UAAA,CAAAT,cAAA,CAAAQ,UAAA,IAAzCE,UAAU,CAAAD,UAAA,IAAEE,aAAa,CAAAF,UAAA,IAEhC,GAAM,CAAAG,YAAY,CAAG,QAAf,CAAAA,YAAYA,CAAIC,KAAK,CAAK,CAC9BF,aAAa,CAACE,KAAK,CAACC,MAAM,CAACC,KAAK,CAAC,CACnC,CAAC,CAED,GAAM,CAAAC,MAAM,CAA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e,CAAApF,YAAY"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,FormControl,TextField}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import EmbeddingCard from'./embeddingCard';import ModelCard from'./modelCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchCustom=function LaunchCustom(){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():'';return modelName.includes(searchTerm.toLowerCase());};var update=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var embeddingResponse,embeddingRegistrations,customEmbeddingRegistrations,llmResponse,llmRegistrations,customLLMRegistrations,newEmbeddingData,newLLMData;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context3.next=2;break;}return _context3.abrupt(\"return\");case 2:_context3.prev=2;setIsCallingApi(true);_context3.next=6;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/embedding\"),{method:'GET'});case 6:embeddingResponse=_context3.sent;_context3.next=9;return embeddingResponse.json();case 9:embeddingRegistrations=_context3.sent;customEmbeddingRegistrations=embeddingRegistrations.filter(function(data){return!data.is_builtin;});_context3.next=13;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/LLM\"),{method:'GET'});case 13:llmResponse=_context3.sent;_context3.next=16;return llmResponse.json();case 16:llmRegistrations=_context3.sent;customLLMRegistrations=llmRegistrations.filter(function(data){return!data.is_builtin;});_context3.next=20;return Promise.all(customEmbeddingRegistrations.map(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/embedding/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context.sent;_context.t0=_objectSpread;_context.t1=_objectSpread;_context.t2={};_context.next=8;return desc.json();case 8:_context.t3=_context.sent;_context.t4=(0,_context.t1)(_context.t2,_context.t3);_context.t5={};_context.t6={is_builtin:registration.is_builtin};return _context.abrupt(\"return\",(0,_context.t0)(_context.t4,_context.t5,_context.t6));case 13:case\"end\":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}()));case 20:newEmbeddingData=_context3.sent;_context3.next=23;return Promise.all(customLLMRegistrations.map(/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(registration){var desc;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/LLM/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context2.sent;_context2.t0=_objectSpread;_context2.t1=_objectSpread;_context2.t2={};_context2.next=8;return desc.json();case 8:_context2.t3=_context2.sent;_context2.t4=(0,_context2.t1)(_context2.t2,_context2.t3);_context2.t5={};_context2.t6={is_builtin:registration.is_builtin};return _context2.abrupt(\"return\",(0,_context2.t0)(_context2.t4,_context2.t5,_context2.t6));case 13:case\"end\":return _context2.stop();}},_callee2);}));return function(_x2){return _ref3.apply(this,arguments);};}()));case 23:newLLMData=_context3.sent;setRegistrationData(newLLMData.concat(newEmbeddingData));_context3.next=30;break;case 27:_context3.prev=27;_context3.t0=_context3[\"catch\"](2);console.error('Error:',_context3.t0);case 30:_context3.prev=30;setIsCallingApi(false);return _context3.finish(30);case 33:case\"end\":return _context3.stop();}},_callee3,null,[[2,27,30,33]]);}));return function update(){return _ref.apply(this,arguments);};}();useEffect(function(){update();},[]);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 custom model name\",value:searchTerm,onChange:handleChange,size:\"small\"})})}),/*#__PURE__*/_jsx(\"div\",{style:style,children:registrationData.filter(function(registration){return filter(registration);}).map(function(filteredRegistration){if(filteredRegistration.max_tokens&&filteredRegistration.dimensions){return/*#__PURE__*/_jsx(EmbeddingCard,{url:endPoint,modelData:filteredRegistration,cardHeight:350,is_custom:true});}else{return/*#__PURE__*/_jsx(ModelCard,{url:endPoint,modelData:filteredRegistration,is_custom:true});}})})]});};export default LaunchCustom;","map":{"version":3,"names":["Box","FormControl","TextField","React","useContext","useEffect","useState","ApiContext","EmbeddingCard","ModelCard","jsx","_jsx","jsxs","_jsxs","LaunchCustom","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","includes","update","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee3","embeddingResponse","embeddingRegistrations","customEmbeddingRegistrations","llmResponse","llmRegistrations","customLLMRegistrations","newEmbeddingData","newLLMData","wrap","_callee3$","_context3","prev","next","abrupt","fetch","concat","method","sent","json","data","is_builtin","Promise","all","map","_ref2","_callee","desc","_callee$","_context","t0","_objectSpread","t1","t2","t3","t4","t5","t6","stop","_x","apply","arguments","_ref3","_callee2","_callee2$","_context2","_x2","console","error","finish","style","display","gridTemplateColumns","paddingLeft","gridGap","m","children","margin","variant","id","type","label","onChange","size","filteredRegistration","max_tokens","dimensions","url","modelData","cardHeight","is_custom"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchCustom.js"],"sourcesContent":["import { Box, FormControl, TextField } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport EmbeddingCard from './embeddingCard'\nimport ModelCard from './modelCard'\n\nconst LaunchCustom = () => {\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 return modelName.includes(searchTerm.toLowerCase())\n }\n\n const update = async () => {\n if (isCallingApi || isUpdatingModel) return\n\n try {\n setIsCallingApi(true)\n\n const embeddingResponse = await fetch(\n `${endPoint}/v1/model_registrations/embedding`,\n {\n method: 'GET',\n }\n )\n\n const embeddingRegistrations = await embeddingResponse.json()\n const customEmbeddingRegistrations = embeddingRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const llmResponse = await fetch(\n `${endPoint}/v1/model_registrations/LLM`,\n {\n method: 'GET',\n }\n )\n const llmRegistrations = await llmResponse.json()\n const customLLMRegistrations = llmRegistrations.filter(\n (data) => !data.is_builtin\n )\n\n const newEmbeddingData = await Promise.all(\n customEmbeddingRegistrations.map(async (registration) => {\n const desc = await fetch(\n `${endPoint}/v1/model_registrations/embedding/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n const newLLMData = await Promise.all(\n customLLMRegistrations.map(async (registration) => {\n const desc = await fetch(\n `${endPoint}/v1/model_registrations/LLM/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n setRegistrationData(newLLMData.concat(newEmbeddingData))\n } catch (error) {\n console.error('Error:', error)\n } finally {\n setIsCallingApi(false)\n }\n }\n\n useEffect(() => {\n update()\n }, [])\n\n const style = {\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',\n paddingLeft: '2rem',\n 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 custom model name\"\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 if (\n filteredRegistration.max_tokens &&\n filteredRegistration.dimensions\n ) {\n return (\n <EmbeddingCard\n url={endPoint}\n modelData={filteredRegistration}\n cardHeight={350}\n is_custom={true}\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E,CAAAD,QAAA,cAEF1F,IAAA,CAACV,WAAW,EAACsG,OAAO,CAAC,UAAU,CAACD,MAAM,CAAC,QAAQ,CAAAD,QAAA,cAC7C1F,IAAA,CAACT,SAAS,EACRsG,EAAE,CAAC,QAAQ,CACXC,IAAI,CAAC,QAAQ,CACbC,KAAK,CAAC,8BAA8B,CACpCzE,KAAK,CAAEL,UAAW,CAClB+E,QAAQ,CAAE7E,YAAa,CACvB8E,IAAI,CAAC,OAAO,CACb,CAAC,CACS,CAAC,CACX,CAAC,cACNjG,IAAA,QAAKoF,KAAK,CAAEA,KAAM,CAAAM,QAAA,CACflF,gBAAgB,CACde,MAAM,CAAC,SAACC,YAAY,QAAK,CAAAD,MAAM,CAACC,YAAY,CAAC,GAAC,CAC9CkC,GAAG,CAAC,SAACwC,oBAAoB,CAAK,CAC7B,GACEA,oBAAoB,CAACC,UAAU,EAC/BD,oBAAoB,CAACE,UAAU,CAC/B,CACA,mBACEpG,IAAA,CAACH,aAAa,EACZwG,GAAG,CAAEjG,QAAS,CACdkG,SAAS,CAAEJ,oBAAqB,CAChCK,UAAU,CAAE,GAAI,CAChBC,SAAS,CAAE,IAAK,CACjB,CAAC,CAEN,CAAC,IAAM,CACL,mBACExG,IAAA,CAACF,SAAS,EACRuG,GAAG,CAAEjG,QAAS,CACdkG,SAAS,CAAEJ,oBAAqB,CAChCM,SAAS,CAAE,IAAK,CACjB,CAAC,CAEN,CACF,CAAC,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAArG,YAAY"},"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 _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{RocketLaunchOutlined,UndoOutlined}from'@mui/icons-material';import{Box,Chip,CircularProgress}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{v1 as uuidv1}from'uuid';import{ApiContext}from'../../components/apiContext';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var CARD_HEIGHT=270;var CARD_WIDTH=270;var RerankCard=function RerankCard(_ref){var url=_ref.url,modelData=_ref.modelData;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;// UseEffects for parameter selection, change options based on previous selections\nuseEffect(function(){},[modelData]);var launchModel=function launchModel(url){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);var uuid=uuidv1();var modelDataWithID={model_uid:uuid,model_name:modelData.model_name,model_type:'rerank'};// First fetch request to initiate the model\nfetch(url+'/v1/models',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(modelDataWithID)}).then(function(){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'},titleContainer:{minHeight:'120px'},h2:{margin:'10px 10px',fontSize:'20px'},buttonsContainer:{display:'flex',margin:'0 auto',marginTop:'120px',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'},langRow:{margin:'2px 5px 40px 5px'}};// 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){setSelected(true);}},children:[/*#__PURE__*/_jsxs(Box,{style:styles.descriptionCard,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.titleContainer,children:[/*#__PURE__*/_jsx(\"h2\",{style:styles.h2,children:modelData.model_name}),/*#__PURE__*/_jsxs(\"div\",{style:styles.langRow,children:[function(){if(modelData.language.includes('en')){return/*#__PURE__*/_jsx(Chip,{label:\"EN\",variant:\"outlined\",size:\"small\",sx:{marginRight:'10px'}});}}(),function(){if(modelData.language.includes('zh')){return/*#__PURE__*/_jsx(Chip,{label:\"ZH\",variant:\"outlined\",size:\"small\"});}}()]})]}),hover?/*#__PURE__*/_jsx(\"p\",{style:styles.instructionText,children:\"Click with mouse to launch the model\"}):/*#__PURE__*/_jsx(\"p\",{style:styles.instructionText})]}),/*#__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__*/_jsxs(Box,{style:styles.buttonsContainer,children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch Rerank\",style:styles.buttonContainer,onClick:function onClick(){return launchModel(url,modelData);},disabled:isCallingApi||isUpdatingModel||!modelData,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(!modelData){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:\"Launch Rerank\",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 RerankCard;","map":{"version":3,"names":["RocketLaunchOutlined","UndoOutlined","Box","Chip","CircularProgress","React","useContext","useEffect","useState","v1","uuidv1","ApiContext","jsx","_jsx","jsxs","_jsxs","CARD_HEIGHT","CARD_WIDTH","RerankCard","_ref","url","modelData","_useState","_useState2","_slicedToArray","hover","setHover","_useState3","_useState4","selected","setSelected","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","launchModel","uuid","modelDataWithID","model_uid","model_name","model_type","fetch","method","headers","body","JSON","stringify","then","catch","error","console","styles","container","display","position","width","concat","height","border","borderRadius","background","overflow","containerSelected","boxShadow","descriptionCard","top","left","padding","parameterCard","img","margin","objectFit","titleContainer","minHeight","h2","fontSize","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","langRow","style","onMouseEnter","onMouseLeave","onClick","children","language","includes","label","variant","size","sx","marginRight","_objectSpread","title","disabled"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/rerankCard.js"],"sourcesContent":["import { RocketLaunchOutlined, UndoOutlined } from '@mui/icons-material'\nimport { Box, Chip, CircularProgress } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { v1 as uuidv1 } from 'uuid'\n\nimport { ApiContext } from '../../components/apiContext'\n\nconst CARD_HEIGHT = 270\nconst CARD_WIDTH = 270\n\nconst RerankCard = ({ url, modelData }) => {\n const [hover, setHover] = useState(false)\n const [selected, setSelected] = useState(false)\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n\n // UseEffects for parameter selection, change options based on previous selections\n useEffect(() => {}, [modelData])\n\n const launchModel = (url) => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n\n setIsCallingApi(true)\n\n const uuid = uuidv1()\n const modelDataWithID = {\n model_uid: uuid,\n model_name: modelData.model_name,\n model_type: 'rerank',\n }\n\n // First fetch request to initiate the model\n fetch(url + '/v1/models', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(modelDataWithID),\n })\n .then(() => {\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 titleContainer: {\n minHeight: '120px',\n },\n h2: {\n margin: '10px 10px',\n fontSize: '20px',\n },\n buttonsContainer: {\n display: 'flex',\n margin: '0 auto',\n marginTop: '120px',\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 langRow: {\n margin: '2px 5px 40px 5px',\n },\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) {\n setSelected(true)\n }\n }}\n >\n {/* First state: show description page */}\n <Box style={styles.descriptionCard}>\n <div style={styles.titleContainer}>\n <h2 style={styles.h2}>{modelData.model_name}</h2>\n <div style={styles.langRow}>\n {(() => {\n if (modelData.language.includes('en')) {\n return (\n <Chip\n label=\"EN\"\n variant=\"outlined\"\n size=\"small\"\n sx={{ marginRight: '10px' }}\n />\n )\n }\n })()}\n {(() => {\n if (modelData.language.includes('zh')) {\n return <Chip label=\"ZH\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n </div>\n </div>\n {hover ? (\n <p style={styles.instructionText}>\n Click with mouse to launch the model\n </p>\n ) : (\n <p style={styles.instructionText}></p>\n )}\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 style={styles.buttonsContainer}>\n <button\n title=\"Launch Rerank\"\n style={styles.buttonContainer}\n onClick={() => launchModel(url, modelData)}\n disabled={isCallingApi || isUpdatingModel || !modelData}\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 (!modelData) {\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=\"Launch Rerank\"\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 RerankCard\n"],"mappings":"yRAAA,OAASA,oBAAoB,CAAEC,YAAY,KAAQ,qBAAqB,CACxE,OAASC,GAAG,CAAEC,IAAI,CAAEC,gBAAgB,KAAQ,eAAe,CAC3D,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,EAAE,GAAI,CAAAC,MAAM,KAAQ,MAAM,CAEnC,OAASC,UAAU,KAAQ,6BAA6B,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAExD,GAAM,CAAAC,WAAW,CAAG,GAAG,CACvB,GAAM,CAAAC,UAAU,CAAG,GAAG,CAEtB,GAAM,CAAAC,UAAU,CAAG,QAAb,CAAAA,UAAUA,CAAAC,IAAA,CAA2B,IAArB,CAAAC,GAAG,CAAAD,IAAA,CAAHC,GAAG,CAAEC,SAAS,CAAAF,IAAA,CAATE,SAAS,CAClC,IAAAC,SAAA,CAA0Bd,QAAQ,CAAC,KAAK,CAAC,CAAAe,UAAA,CAAAC,cAAA,CAAAF,SAAA,IAAlC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CAACkC,UAAW,CAAAsB,QAAA,cAC5B/F,IAAA,CAACZ,YAAY,EAACwF,KAAK,CAAC,SAAS,CAACwB,IAAI,CAAC,MAAM,CAAE,CAAC,CACzC,CAAC,CACA,CAAC,EACN,CAAC,EACH,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAA/F,UAAU"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,Checkbox,FormControl,FormControlLabel,FormHelperText,Radio,RadioGroup}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{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import Title from'../../components/Title';import{useMode}from'../../theme';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:'English',zh:'Chinese'};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_specs:[],prompt_style:undefined}),_useState10=_slicedToArray(_useState9,2),formData=_useState10[0],setFormData=_useState10[1];var _useState11=useState('vicuna'),_useState12=_slicedToArray(_useState11,2),promptStyleLabel=_useState12[0],setPromptStyleLabel=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),promptStyles=_useState14[0],setPromptStyles=_useState14[1];// model name must be\n// 1. Starts with an alphanumeric character (a letter or a digit).\n// 2. Followed by any number of alphanumeric characters, underscores (_), or hyphens (-).\nvar errorModelName=!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(formData.model_name);var errorModelDescription=!/^[A-Za-z0-9\\s!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]{0,500}$/.test(formData.model_description);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 errorAny=errorModelName||errorModelDescription||errorContextLength||errorLanguage||errorAbility||errorModelSize;useEffect(function(){var getBuiltInPromptStyles=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,errorData,data,res,key,v;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(endPoint+'/v1/models/prompts',{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;res=[];for(key in data){v=data[key];v['name']=key;res.push(v);}setPromptStyles(res);case 16:case\"end\":return _context.stop();}},_callee);}));return function getBuiltInPromptStyles(){return _ref.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);});}});var isModelFormatPytorch=function isModelFormatPytorch(){return modelFormat==='pytorch';};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 _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _getPathComponents,baseDir,filename,ps,response,errorData;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0: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}];}if(formData.model_ability.includes('chat')){ps=promptStyles.find(function(item){return item.name===promptStyleLabel;});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};}}if(!errorAny){_context2.next=5;break;}setErrorMsg('Please fill in valid value for all fields');return _context2.abrupt(\"return\");case 5:_context2.prev=5;_context2.next=8;return fetch(endPoint+'/v1/model_registrations/LLM',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 8:response=_context2.sent;if(response.ok){_context2.next=16;break;}_context2.next=12;return response.json();case 12: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=17;break;case 16:setSuccessMsg('Model has been registered successfully! Navigate to launch model page to proceed.');case 17:_context2.next=23;break;case 19:_context2.prev=19;_context2.t0=_context2[\"catch\"](5);console.error('There was a problem with the fetch operation:',_context2.t0);setErrorMsg(_context2.t0.message||'An unexpected error occurred.');case 23:case\"end\":return _context2.stop();}},_callee2,null,[[5,19]]);}));return function handleClick(){return _ref2.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){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__*/_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,{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\"})]}),formData.model_ability.includes('chat')&&/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Prompt styles\"}),/*#__PURE__*/_jsx(FormHelperText,{children:\"Select a prompt style that aligns with the training data of your model.\"}),/*#__PURE__*/_jsx(RadioGroup,{value:promptStyleLabel,onChange:function onChange(e){setPromptStyleLabel(e.target.value);},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:promptStyles.map(function(p){return/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:p.name,control:/*#__PURE__*/_jsx(Radio,{}),label:p.name})});})})})]}),/*#__PURE__*/_jsxs(Box,{width:'100%',children:[successMsg!==''&&/*#__PURE__*/_jsxs(Alert,{severity:\"success\",children:[/*#__PURE__*/_jsx(AlertTitle,{children:\"Success\"}),successMsg]}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]});};export default 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":["Box","Checkbox","FormControl","FormControlLabel","FormHelperText","Radio","RadioGroup","Alert","AlertTitle","Button","TextField","React","useContext","useEffect","useState","ApiContext","ErrorMessageSnackBar","Title","useMode","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_specs","prompt_style","undefined","_useState10","formData","setFormData","_useState11","_useState12","promptStyleLabel","setPromptStyleLabel","_useState13","_useState14","promptStyles","setPromptStyles","errorModelName","test","errorModelDescription","errorContextLength","errorLanguage","length","errorAbility","errorModelSize","some","spec","model_size_in_billions","errorAny","getBuiltInPromptStyles","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","errorData","data","res","key","v","wrap","_callee$","_context","prev","next","fetch","method","headers","sent","ok","json","concat","status","detail","push","stop","apply","arguments","catch","error","message","console","isModelFormatPytorch","getPathComponents","path","normalizedPath","replace","baseDir","substring","lastIndexOf","filename","handleClick","_ref2","_callee2","_getPathComponents","ps","_callee2$","_context2","model_format","quantizations","model_id","model_file_name_template","model_uri","includes","find","item","name","style_name","system_prompt","roles","intra_message_sep","inter_message_sep","abrupt","body","JSON","stringify","model","persist","t0","toggleLanguage","lang","_objectSpread","filter","l","_toConsumableArray","toggleAbility","ability","a","m","children","title","padding","sx","styles","baseFormControl","label","defaultValue","size","helperText","onChange","event","target","value","style","paddingLeft","e","checkboxWrapper","marginLeft","control","parseInt","Number","color","map","marginRight","checked","toLowerCase","p","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 {\n Box,\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText,\n Radio,\n RadioGroup,\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'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport Title from '../../components/Title'\nimport { useMode } from '../../theme'\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_specs: [],\n prompt_style: undefined,\n })\n const [promptStyleLabel, setPromptStyleLabel] = useState('vicuna')\n const [promptStyles, setPromptStyles] = useState([])\n\n // model name must be\n // 1. Starts with an alphanumeric character (a letter or a digit).\n // 2. Followed by any number of alphanumeric characters, underscores (_), or hyphens (-).\n const errorModelName = !/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(\n formData.model_name\n )\n const errorModelDescription =\n !/^[A-Za-z0-9\\s!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~]{0,500}$/.test(\n formData.model_description\n )\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 errorAny =\n errorModelName ||\n errorModelDescription ||\n errorContextLength ||\n errorLanguage ||\n errorAbility ||\n errorModelSize\n\n useEffect(() => {\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 })\n\n const isModelFormatPytorch = () => {\n return modelFormat === 'pytorch'\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 (!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 if (formData.model_ability.includes('chat')) {\n const ps = promptStyles.find((item) => item.name === promptStyleLabel)\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 }\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 fetch(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 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 <Box padding=\"20px\"></Box>\n\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>\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({ ...formData, model_description: event.target.value })\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 {formData.model_ability.includes('chat') && (\n <FormControl sx={styles.baseFormControl}>\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Prompt styles\n </label>\n <FormHelperText>\n Select a prompt style that aligns with the training data of your\n model.\n </FormHelperText>\n <RadioGroup\n value={promptStyleLabel}\n onChange={(e) => {\n setPromptStyleLabel(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n {promptStyles.map((p) => (\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value={p.name}\n control={<Radio />}\n label={p.name}\n />\n </Box>\n ))}\n </Box>\n </RadioGroup>\n </FormControl>\n )}\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 </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,OACEA,GAAG,CACHC,QAAQ,CACRC,WAAW,CACXC,gBAAgB,CAChBC,cAAc,CACdC,KAAK,CACLC,UAAU,KACL,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,CAE9D,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,KAAK,KAAM,wBAAwB,CAC1C,OAASC,OAAO,KAAQ,aAAa,QAAAC,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AAA,eACvBlJ,IAAA,CAACZ,UAAU,EAAA8J,QAAA,CAAC,SAAO,CAAY,CAAC,CAC/BhI,UAAU,EACN,CACR,cACDlB,IAAA,CAACX,MAAM,EACL2L,OAAO,CAAC,WAAW,CACnBR,KAAK,CAAC,SAAS,CACfS,IAAI,CAAC,QAAQ,CACbC,OAAO,CAAEtE,WAAY,CAAAsC,QAAA,CACtB,gBAED,CAAQ,CAAC,EACN,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAxI,aAAa,CAE5B,GAAM,CAAA4I,MAAM,CAAG,CACbC,eAAe,CAAE,CACfuB,KAAK,CAAE,MAAM,CACbK,MAAM,CAAE,QAAQ,CAChBzB,IAAI,CAAE,OACR,CAAC,CACDS,eAAe,CAAE,CACfiB,OAAO,CAAE,MAAM,CACfC,QAAQ,CAAE,MAAM,CAChBC,QAAQ,CAAE,KACZ,CAAC,CACDC,gBAAgB,CAAE,CAChBtB,WAAW,CAAE,CACf,CAAC,CACDuB,2BAA2B,CAAE,CAC3BvB,WAAW,CAAE,EACf,CAAC,CACDwB,SAAS,CAAE,CACTX,KAAK,CAAE,MAAM,CACbK,MAAM,CAAE,MACV,CAAC,CACDnF,KAAK,CAAE,CACL0F,UAAU,CAAE,MAAM,CAClBP,MAAM,CAAE,OAAO,CACf/B,OAAO,CAAE,KAAK,CACduC,YAAY,CAAE,KAChB,CACF,CAAC"},"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}from'@mui/material';import IconButton from'@mui/material/IconButton';import Typography from'@mui/material/Typography';import React,{useContext,useEffect,useState}from'react';import{v1 as uuidv1}from'uuid';import{ApiContext}from'../../components/apiContext';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var CARD_HEIGHT=350;var CARD_WIDTH=300;var ModelCard=function ModelCard(_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),modelFormat=_useState6[0],setModelFormat=_useState6[1];var _useState7=useState(''),_useState8=_slicedToArray(_useState7,2),modelSize=_useState8[0],setModelSize=_useState8[1];var _useState9=useState(''),_useState10=_slicedToArray(_useState9,2),quantization=_useState10[0],setQuantization=_useState10[1];var _useState11=useState('auto'),_useState12=_slicedToArray(_useState11,2),nGPU=_useState12[0],setNGPU=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),formatOptions=_useState14[0],setFormatOptions=_useState14[1];var _useState15=useState([]),_useState16=_slicedToArray(_useState15,2),sizeOptions=_useState16[0],setSizeOptions=_useState16[1];var _useState17=useState([]),_useState18=_slicedToArray(_useState17,2),quantizationOptions=_useState18[0],setQuantizationOptions=_useState18[1];var _useState19=useState(false),_useState20=_slicedToArray(_useState19,2),customDeleted=_useState20[0],setCustomDeleted=_useState20[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;});}};// 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===parseFloat(modelSize);}).flatMap(function(spec){return spec.quantizations;})));setQuantizationOptions(quants);}},[modelFormat,modelSize,modelData]);var launchModel=function launchModel(url){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);var uuid=uuidv1();var modelDataWithID={model_uid:uuid,model_name:modelData.model_name,model_format:modelFormat,model_size_in_billions:modelSize,quantization:quantization,n_gpu:nGPU==='0'?null:nGPU==='auto'?'auto':parseInt(nGPU,10)};// First fetch request to initiate the model\nfetch(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:'30px',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();fetch(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(\"div\",{style:styles.tagRow,children:[function(){if(modelData.model_lang.includes('en')){return/*#__PURE__*/_jsx(Chip,{label:\"EN\",variant:\"outlined\",size:\"small\"});}}(),function(){if(modelData.model_lang.includes('zh')){return/*#__PURE__*/_jsx(Chip,{label:\"ZH\",variant:\"outlined\",size:\"small\",sx:{marginLeft:'10px'}});}}(),function(){if(modelData.model_specs.some(function(spec){return isCached(spec);})){return/*#__PURE__*/_jsx(Chip,{label:\"Cached\",variant:\"outlined\",size:\"small\",sx:{marginLeft:'10px'}});}}(),function(){if(is_custom&&customDeleted){return/*#__PURE__*/_jsx(Chip,{label:\"Deleted\",variant:\"outlined\",size:\"small\",sx:{marginLeft:'10px'}});}}()]}),/*#__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,spacing: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:(modelData.is_builtin||modelFormat==='pytorch')&&/*#__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=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===modelSize;});var cached=modelFormat==='pytorch'?specs[0].cache_status&&specs[0].cache_status===true:specs[0].cache_status&&specs[0].cache_status[index]===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'?1:gpuAvailable)).map(function(v){return/*#__PURE__*/_jsx(MenuItem,{value:v,children:v},v);})})]})})]})}),/*#__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 ModelCard;","map":{"version":3,"names":["ChatOutlined","EditNoteOutlined","HelpCenterOutlined","RocketLaunchOutlined","UndoOutlined","DeleteIcon","Box","Chip","CircularProgress","FormControl","Grid","InputLabel","MenuItem","Select","Stack","IconButton","Typography","React","useContext","useEffect","useState","v1","uuidv1","ApiContext","jsx","_jsx","jsxs","_jsxs","CARD_HEIGHT","CARD_WIDTH","ModelCard","_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","modelFormat","setModelFormat","_useState7","_useState8","modelSize","setModelSize","_useState9","_useState10","quantization","setQuantization","_useState11","_useState12","nGPU","setNGPU","_useState13","_useState14","formatOptions","setFormatOptions","_useState15","_useState16","sizeOptions","setSizeOptions","_useState17","_useState18","quantizationOptions","setQuantizationOptions","_useState19","_useState20","customDeleted","setCustomDeleted","range","start","end","Array","fill","undefined","map","_","i","isCached","spec","model_format","cache_status","some","cs","modelFamily","model_specs","formats","_toConsumableArray","Set","sizes","filter","model_size_in_billions","quants","parseFloat","flatMap","quantizations","launchModel","uuid","modelDataWithID","model_uid","model_name","n_gpu","parseInt","fetch","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","model_lang","includes","label","size","sx","marginLeft","model_description","Math","floor","context_length","model_ability","_objectSpread","mx","item","xs","fullWidth","id","labelId","value","onChange","target","format","specs","cached","displayedFormat","displayedSize","is_builtin","quant","index","displayedQuant","v","title"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/modelCard.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} from '@mui/material'\nimport IconButton from '@mui/material/IconButton'\nimport Typography from '@mui/material/Typography'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { v1 as uuidv1 } from 'uuid'\n\nimport { ApiContext } from '../../components/apiContext'\n\nconst CARD_HEIGHT = 350\nconst CARD_WIDTH = 300\n\nconst ModelCard = ({ url, modelData, gpuAvailable, is_custom = false }) => {\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 [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 // 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 === parseFloat(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 uuid = uuidv1()\n const modelDataWithID = {\n model_uid: uuid,\n model_name: modelData.model_name,\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantization: quantization,\n n_gpu:\n nGPU === '0' ? null : nGPU === 'auto' ? 'auto' : parseInt(nGPU, 10),\n }\n\n // First fetch request to initiate the model\n fetch(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: '30px',\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 fetch(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 <div style={styles.tagRow}>\n {(() => {\n if (modelData.model_lang.includes('en')) {\n return <Chip label=\"EN\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n {(() => {\n if (modelData.model_lang.includes('zh')) {\n return (\n <Chip\n label=\"ZH\"\n variant=\"outlined\"\n size=\"small\"\n sx={{ marginLeft: '10px' }}\n />\n )\n }\n })()}\n {(() => {\n if (modelData.model_specs.some((spec) => isCached(spec))) {\n return (\n <Chip\n label=\"Cached\"\n variant=\"outlined\"\n size=\"small\"\n sx={{ marginLeft: '10px' }}\n />\n )\n }\n })()}\n {(() => {\n if (is_custom && customDeleted) {\n return (\n <Chip\n label=\"Deleted\"\n variant=\"outlined\"\n size=\"small\"\n sx={{ marginLeft: '10px' }}\n />\n )\n }\n })()}\n </div>\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 spacing={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 {(modelData.is_builtin || modelFormat === 'pytorch') && (\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) => spec.model_size_in_billions === modelSize\n )\n\n const cached =\n modelFormat === 'pytorch'\n ? specs[0].cache_status &&\n specs[0].cache_status === true\n : specs[0].cache_status &&\n specs[0].cache_status[index] === true\n const displayedQuant = cached\n ? quant + ' (cached)'\n : quant\n\n return (\n <MenuItem key={quant} value={quant}>\n {displayedQuant}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n )}\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(0, modelFormat !== 'pytorch' ? 1 : gpuAvailable)\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>\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 ModelCard\n"],"mappings":"8aAAA,OACEA,YAAY,CACZC,gBAAgB,CAChBC,kBAAkB,CAClBC,oBAAoB,CACpBC,YAAY,KACP,qBAAqB,CAC5B,MAAO,CAAAC,UAAU,KAAM,4BAA4B,CACnD,OACEC,GAAG,CACHC,IAAI,CACJC,gBAAgB,CAChBC,WAAW,CACXC,IAAI,CACJC,UAAU,CACVC,QAAQ,CACRC,MAAM,CACNC,KAAK,KACA,eAAe,CACtB,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,UAAU,KAAM,0BAA0B,CACjD,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,EAAE,GAAI,CAAAC,MAAM,KAA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MAAM,CAACiC,UAAW,CAAAyB,QAAA,cAC5B3K,IAAA,CAACrB,YAAY,EAAC0K,KAAK,CAAC,SAAS,CAACgC,IAAI,CAAC,MAAM,CAAE,CAAC,CACzC,CAAC,CACA,CAAC,EACN,CAAC,EACH,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAhL,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1 +0,0 @@
1
- {"ast":null,"code":"import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{Box,FormControl,TextField}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{ApiContext}from'../../components/apiContext';import EmbeddingCard from'./embeddingCard';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var LaunchEmbedding=function LaunchEmbedding(){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():'';if(!modelName.includes(searchTerm.toLowerCase())){return false;}return true;};var update=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var response,registrations,newRegistrationData,builtinRegistrations;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(isCallingApi||isUpdatingModel)){_context2.next=2;break;}return _context2.abrupt(\"return\");case 2:_context2.prev=2;setIsCallingApi(true);_context2.next=6;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/embedding\"),{method:'GET'});case 6:response=_context2.sent;_context2.next=9;return response.json();case 9:registrations=_context2.sent;_context2.next=12;return Promise.all(registrations.map(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(registration){var desc;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(\"\".concat(endPoint,\"/v1/model_registrations/embedding/\").concat(registration.model_name),{method:'GET'});case 2:desc=_context.sent;_context.t0=_objectSpread;_context.t1=_objectSpread;_context.t2={};_context.next=8;return desc.json();case 8:_context.t3=_context.sent;_context.t4=(0,_context.t1)(_context.t2,_context.t3);_context.t5={};_context.t6={is_builtin:registration.is_builtin};return _context.abrupt(\"return\",(0,_context.t0)(_context.t4,_context.t5,_context.t6));case 13:case\"end\":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}()));case 12:newRegistrationData=_context2.sent;builtinRegistrations=newRegistrationData.filter(function(v){return v.is_builtin;});setRegistrationData(builtinRegistrations);_context2.next=20;break;case 17:_context2.prev=17;_context2.t0=_context2[\"catch\"](2);console.error('Error:',_context2.t0);case 20:_context2.prev=20;setIsCallingApi(false);return _context2.finish(20);case 23:case\"end\":return _context2.stop();}},_callee2,null,[[2,17,20,23]]);}));return function update(){return _ref.apply(this,arguments);};}();useEffect(function(){update();// eslint-disable-next-line\n},[]);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 embedding model name\",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(EmbeddingCard,{url:endPoint,modelData:filteredRegistration});})})]});};export default LaunchEmbedding;","map":{"version":3,"names":["Box","FormControl","TextField","React","useContext","useEffect","useState","ApiContext","EmbeddingCard","jsx","_jsx","jsxs","_jsxs","LaunchEmbedding","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","includes","update","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee2","response","registrations","newRegistrationData","builtinRegistrations","wrap","_callee2$","_context2","prev","next","abrupt","fetch","concat","method","sent","json","Promise","all","map","_ref2","_callee","desc","_callee$","_context","t0","_objectSpread","t1","t2","t3","t4","t5","t6","is_builtin","stop","_x","apply","arguments","v","console","error","finish","style","display","gridTemplateColumns","paddingLeft","gridGap","m","children","margin","variant","id","type","label","onChange","size","filteredRegistration","url","modelData"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/launchEmbedding.js"],"sourcesContent":["import { Box, FormControl, TextField } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\n\nimport { ApiContext } from '../../components/apiContext'\nimport EmbeddingCard from './embeddingCard'\n\nconst LaunchEmbedding = () => {\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 if (!modelName.includes(searchTerm.toLowerCase())) {\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 fetch(\n `${endPoint}/v1/model_registrations/embedding`,\n {\n method: 'GET',\n }\n )\n\n const registrations = await response.json()\n const newRegistrationData = await Promise.all(\n registrations.map(async (registration) => {\n const desc = await fetch(\n `${endPoint}/v1/model_registrations/embedding/${registration.model_name}`,\n {\n method: 'GET',\n }\n )\n\n return {\n ...(await desc.json()),\n is_builtin: registration.is_builtin,\n }\n })\n )\n\n const builtinRegistrations = newRegistrationData.filter(\n (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()\n // eslint-disable-next-line\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 embedding model name\"\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 <EmbeddingCard url={endPoint} modelData={filteredRegistration} />\n ))}\n </div>\n </Box>\n )\n}\n\nexport default LaunchEmbedding\n"],"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C,EAClE,CAAC,CACD,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAAtF,eAAe"},"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 from'react';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import Title from'../../components/Title';import LaunchCustom from'./launchCustom';import LaunchEmbedding from'./launchEmbedding';import LaunchLLM from'./launchLLM';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 _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);};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:\"Embedding Models\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Models\",value:\"3\"}),/*#__PURE__*/_jsx(Tab,{label:\"Custom Models\",value:\"4\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"1\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchLLM,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchEmbedding,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchRerank,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"4\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchCustom,{})})]})]});};export default LaunchModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","ErrorMessageSnackBar","Title","LaunchCustom","LaunchEmbedding","LaunchLLM","LaunchRerank","jsx","_jsx","jsxs","_jsxs","LaunchModel","_React$useState","useState","_React$useState2","_slicedToArray","value","setValue","handleTabChange","event","newValue","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 from 'react'\n\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport Title from '../../components/Title'\nimport LaunchCustom from './launchCustom'\nimport LaunchEmbedding from './launchEmbedding'\nimport LaunchLLM from './launchLLM'\nimport LaunchRerank from './launchRerank'\n\nconst LaunchModel = () => {\n const [value, setValue] = React.useState('1')\n\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n }\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=\"Embedding Models\" value=\"2\" />\n <Tab label=\"Rerank Models\" value=\"3\" />\n <Tab label=\"Custom Models\" value=\"4\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <LaunchLLM />\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <LaunchEmbedding />\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <LaunchR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