xinference 1.9.0__py3-none-any.whl → 1.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xinference might be problematic. Click here for more details.
- xinference/_version.py +3 -3
- xinference/api/restful_api.py +415 -1
- xinference/constants.py +2 -0
- xinference/core/model.py +3 -4
- xinference/core/supervisor.py +29 -1
- xinference/core/worker.py +4 -1
- xinference/deploy/cmdline.py +2 -0
- xinference/deploy/test/test_cmdline.py +1 -1
- xinference/model/audio/core.py +5 -0
- xinference/model/audio/cosyvoice.py +0 -1
- xinference/model/audio/kokoro.py +1 -1
- xinference/model/audio/kokoro_zh.py +124 -0
- xinference/model/audio/model_spec.json +64 -20
- xinference/model/embedding/flag/core.py +5 -0
- xinference/model/embedding/llama_cpp/core.py +22 -19
- xinference/model/embedding/sentence_transformers/core.py +19 -4
- xinference/model/embedding/vllm/core.py +40 -8
- xinference/model/image/cache_manager.py +56 -0
- xinference/model/image/core.py +9 -0
- xinference/model/image/model_spec.json +116 -9
- xinference/model/image/stable_diffusion/core.py +141 -31
- xinference/model/llm/core.py +10 -0
- xinference/model/llm/llama_cpp/core.py +42 -40
- xinference/model/llm/llm_family.json +435 -23
- xinference/model/llm/llm_family.py +1 -0
- xinference/model/llm/mlx/core.py +52 -33
- xinference/model/llm/sglang/core.py +2 -44
- xinference/model/llm/tool_parsers/__init__.py +58 -0
- xinference/model/llm/tool_parsers/abstract_tool_parser.py +33 -0
- xinference/model/llm/tool_parsers/deepseek_r1_tool_parser.py +128 -0
- xinference/model/llm/tool_parsers/deepseek_v3_tool_parser.py +145 -0
- xinference/model/llm/tool_parsers/glm4_tool_parser.py +123 -0
- xinference/model/llm/tool_parsers/llama3_tool_parser.py +77 -0
- xinference/model/llm/tool_parsers/qwen_tool_parser.py +320 -0
- xinference/model/llm/transformers/core.py +6 -12
- xinference/model/llm/utils.py +128 -46
- xinference/model/llm/vllm/core.py +8 -61
- xinference/model/rerank/core.py +3 -0
- xinference/model/rerank/sentence_transformers/core.py +1 -1
- xinference/model/rerank/vllm/core.py +56 -6
- xinference/model/utils.py +1 -2
- xinference/model/video/model_spec.json +95 -1
- xinference/thirdparty/cosyvoice/bin/export_jit.py +3 -4
- xinference/thirdparty/cosyvoice/bin/export_onnx.py +49 -126
- xinference/thirdparty/cosyvoice/bin/{inference.py → inference_deprecated.py} +1 -0
- xinference/thirdparty/cosyvoice/bin/train.py +23 -3
- xinference/thirdparty/cosyvoice/cli/cosyvoice.py +8 -4
- xinference/thirdparty/cosyvoice/cli/frontend.py +4 -4
- xinference/thirdparty/cosyvoice/cli/model.py +53 -75
- xinference/thirdparty/cosyvoice/dataset/dataset.py +5 -18
- xinference/thirdparty/cosyvoice/dataset/processor.py +24 -25
- xinference/thirdparty/cosyvoice/flow/decoder.py +24 -433
- xinference/thirdparty/cosyvoice/flow/flow.py +6 -14
- xinference/thirdparty/cosyvoice/flow/flow_matching.py +33 -145
- xinference/thirdparty/cosyvoice/hifigan/generator.py +169 -1
- xinference/thirdparty/cosyvoice/llm/llm.py +108 -17
- xinference/thirdparty/cosyvoice/transformer/upsample_encoder.py +14 -115
- xinference/thirdparty/cosyvoice/utils/common.py +20 -0
- xinference/thirdparty/cosyvoice/utils/executor.py +8 -4
- xinference/thirdparty/cosyvoice/utils/file_utils.py +45 -1
- xinference/thirdparty/cosyvoice/utils/losses.py +37 -0
- xinference/thirdparty/cosyvoice/utils/mask.py +35 -1
- xinference/thirdparty/cosyvoice/utils/train_utils.py +24 -6
- xinference/thirdparty/cosyvoice/vllm/cosyvoice2.py +103 -0
- xinference/types.py +105 -2
- xinference/ui/gradio/chat_interface.py +2 -0
- xinference/ui/gradio/media_interface.py +353 -7
- xinference/ui/web/ui/build/asset-manifest.json +3 -3
- xinference/ui/web/ui/build/index.html +1 -1
- xinference/ui/web/ui/build/static/js/main.1086c759.js +3 -0
- xinference/ui/web/ui/build/static/js/main.1086c759.js.map +1 -0
- xinference/ui/web/ui/node_modules/.cache/babel-loader/3c5758bd12fa334294b1de0ff6b1a4bac8d963c45472eab9dc3e530d82aa6b3f.json +1 -0
- xinference/ui/web/ui/node_modules/.cache/babel-loader/a3eb18af328280b139693c9092dff2a0ef8c9a967e6c8956ceee0996611f1984.json +1 -0
- xinference/ui/web/ui/node_modules/.cache/babel-loader/d5c224be7081f18cba1678b7874a9782eba895df004874ff8f243f94ba79942a.json +1 -0
- xinference/ui/web/ui/node_modules/.cache/babel-loader/f7f18bfb539b036a6a342176dd98a85df5057a884a8da978d679f2a0264883d0.json +1 -0
- xinference/ui/web/ui/src/locales/en.json +2 -0
- xinference/ui/web/ui/src/locales/ja.json +2 -0
- xinference/ui/web/ui/src/locales/ko.json +2 -0
- xinference/ui/web/ui/src/locales/zh.json +2 -0
- {xinference-1.9.0.dist-info → xinference-1.10.0.dist-info}/METADATA +16 -12
- {xinference-1.9.0.dist-info → xinference-1.10.0.dist-info}/RECORD +86 -77
- xinference/ui/web/ui/build/static/js/main.4918643a.js +0 -3
- xinference/ui/web/ui/build/static/js/main.4918643a.js.map +0 -1
- xinference/ui/web/ui/node_modules/.cache/babel-loader/3d2a89f0eccc1f90fc5036c9a1d587c2120e6a6b128aae31d1db7d6bad52722b.json +0 -1
- xinference/ui/web/ui/node_modules/.cache/babel-loader/89179f8f51887b9167721860a12412549ff04f78162e921a7b6aa6532646deb2.json +0 -1
- xinference/ui/web/ui/node_modules/.cache/babel-loader/8e5cb82c2ff3299c6a44563fe6b1c5515c9750613c51bb63abee0b1d70fc5019.json +0 -1
- xinference/ui/web/ui/node_modules/.cache/babel-loader/9dc5cfc67dd0617b0272aeef8651f1589b2155a4ff1fd72ad3166b217089b619.json +0 -1
- /xinference/ui/web/ui/build/static/js/{main.4918643a.js.LICENSE.txt → main.1086c759.js.LICENSE.txt} +0 -0
- {xinference-1.9.0.dist-info → xinference-1.10.0.dist-info}/WHEEL +0 -0
- {xinference-1.9.0.dist-info → xinference-1.10.0.dist-info}/entry_points.txt +0 -0
- {xinference-1.9.0.dist-info → xinference-1.10.0.dist-info}/licenses/LICENSE +0 -0
- {xinference-1.9.0.dist-info → xinference-1.10.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/ui/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/ui/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import FilterNoneIcon from'@mui/icons-material/FilterNone';import{Alert,Snackbar,Tooltip}from'@mui/material';import ClipboardJS from'clipboard';import React,{useEffect,useRef,useState}from'react';import{useTranslation}from'react-i18next';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var keyMap={model_size_in_billions:'--size-in-billions',download_hub:'--download_hub',enable_thinking:'--enable_thinking',reasoning_content:'--reasoning_content'};function CopyComponent(_ref){var modelData=_ref.modelData,predefinedKeys=_ref.predefinedKeys;var _useTranslation=useTranslation(),t=_useTranslation.t;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isCopySuccess=_useState2[0],setIsCopySuccess=_useState2[1];var copyRef=useRef(null);var generateCommandLineStatement=function generateCommandLineStatement(params){var args=Object.entries(params).filter(function(_ref2){var _ref3=_slicedToArray(_ref2,2),key=_ref3[0],value=_ref3[1];return predefinedKeys.includes(key)&&value!==null&&value!==undefined||!predefinedKeys.includes(key);}).flatMap(function(_ref4){var _ref5=_slicedToArray(_ref4,2),key=_ref5[0],value=_ref5[1];if(key==='gpu_idx'&&Array.isArray(value)){return\"--gpu-idx \".concat(value.join(','));}else if(key==='peft_model_config'&&typeof value==='object'){var peftArgs=[];if(value.lora_list){peftArgs.push.apply(peftArgs,_toConsumableArray(value.lora_list.map(function(lora){return\"--lora-modules \".concat(lora.lora_name,\" \").concat(lora.local_path);})));}if(value.image_lora_load_kwargs){peftArgs.push.apply(peftArgs,_toConsumableArray(Object.entries(value.image_lora_load_kwargs).map(function(_ref6){var _ref7=_slicedToArray(_ref6,2),k=_ref7[0],v=_ref7[1];return\"--image-lora-load-kwargs \".concat(k,\" \").concat(v);})));}if(value.image_lora_fuse_kwargs){peftArgs.push.apply(peftArgs,_toConsumableArray(Object.entries(value.image_lora_fuse_kwargs).map(function(_ref8){var _ref9=_slicedToArray(_ref8,2),k=_ref9[0],v=_ref9[1];return\"--image-lora-fuse-kwargs \".concat(k,\" \").concat(v);})));}return peftArgs;}else if(key==='quantization_config'&&typeof value==='object'){return Object.entries(value).map(function(_ref10){var _ref11=_slicedToArray(_ref10,2),k=_ref11[0],v=_ref11[1];return\"--quantization-config \".concat(k,\" \").concat(v===null?'none':v);});}else if(key==='envs'&&typeof value==='object'){return Object.entries(value).map(function(_ref12){var _ref13=_slicedToArray(_ref12,2),k=_ref13[0],v=_ref13[1];return\"--env \".concat(k,\" \").concat(v);});}else if(key==='virtual_env_packages'&&Array.isArray(value)){return value.map(function(pkg){return\"--virtual-env-package \".concat(pkg);});}else if(key==='enable_virtual_env'){if(value===true)return\"--enable-virtual-env\";if(value===false)return\"--disable-virtual-env\";return[];}else if(predefinedKeys.includes(key)){var _keyMap$key;var newKey=(_keyMap$key=keyMap[key])!==null&&_keyMap$key!==void 0?_keyMap$key:\"--\".concat(key.replace(/_/g,'-'));return\"\".concat(newKey,\" \").concat(value===false?'false':value===null?'none':value);}else{return\"--\".concat(key,\" \").concat(value===false?'false':value===null?'none':value);}}).join(' ');return\"xinference launch \".concat(args);};useEffect(function(){var _text=generateCommandLineStatement(modelData);var clipboard=new ClipboardJS(copyRef.current,{text:function text(){return _text;}});clipboard.on('success',function(e){e.clearSelection();setIsCopySuccess(true);});var handleClick=function handleClick(event){event.stopPropagation();copyRef.current.focus();};var copy=copyRef.current;copy.addEventListener('click',handleClick);return function(){clipboard.destroy();copy.removeEventListener('click',handleClick);};},[modelData]);return/*#__PURE__*/_jsxs(\"div\",{style:{marginInline:'10px',lineHeight:'14px'},children:[/*#__PURE__*/_jsx(Tooltip,{title:t('launchModel.copyToCommandLine'),placement:\"top\",children:/*#__PURE__*/_jsx(\"div\",{ref:copyRef,children:/*#__PURE__*/_jsx(FilterNoneIcon,{className:\"copyToCommandLine\"})})}),/*#__PURE__*/_jsx(Snackbar,{anchorOrigin:{vertical:'top',horizontal:'center'},open:isCopySuccess,autoHideDuration:1500,onClose:function onClose(){return setIsCopySuccess(false);},children:/*#__PURE__*/_jsx(Alert,{severity:\"success\",variant:\"filled\",sx:{width:'100%'},children:t('components.copySuccess')})})]});}export default CopyComponent;","map":{"version":3,"names":["FilterNoneIcon","Alert","Snackbar","Tooltip","ClipboardJS","React","useEffect","useRef","useState","useTranslation","jsx","_jsx","jsxs","_jsxs","keyMap","model_size_in_billions","download_hub","enable_thinking","reasoning_content","CopyComponent","_ref","modelData","predefinedKeys","_useTranslation","t","_useState","_useState2","_slicedToArray","isCopySuccess","setIsCopySuccess","copyRef","generateCommandLineStatement","params","args","Object","entries","filter","_ref2","_ref3","key","value","includes","undefined","flatMap","_ref4","_ref5","Array","isArray","concat","join","peftArgs","lora_list","push","apply","_toConsumableArray","map","lora","lora_name","local_path","image_lora_load_kwargs","_ref6","_ref7","k","v","image_lora_fuse_kwargs","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","pkg","_keyMap$key","newKey","replace","text","clipboard","current","on","e","clearSelection","handleClick","event","stopPropagation","focus","copy","addEventListener","destroy","removeEventListener","style","marginInline","lineHeight","children","title","placement","ref","className","anchorOrigin","vertical","horizontal","open","autoHideDuration","onClose","severity","variant","sx","width"],"sources":["/home/runner/work/inference/inference/xinference/ui/web/ui/src/scenes/launch_model/components/copyComponent.js"],"sourcesContent":["import FilterNoneIcon from '@mui/icons-material/FilterNone'\nimport { Alert, Snackbar, Tooltip } from '@mui/material'\nimport ClipboardJS from 'clipboard'\nimport React, { useEffect, useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nconst keyMap = {\n model_size_in_billions: '--size-in-billions',\n download_hub: '--download_hub',\n enable_thinking: '--enable_thinking',\n reasoning_content: '--reasoning_content',\n}\n\nfunction CopyComponent({ modelData, predefinedKeys }) {\n const { t } = useTranslation()\n const [isCopySuccess, setIsCopySuccess] = useState(false)\n const copyRef = useRef(null)\n\n const generateCommandLineStatement = (params) => {\n const args = Object.entries(params)\n .filter(\n ([key, value]) =>\n (predefinedKeys.includes(key) &&\n value !== null &&\n value !== undefined) ||\n !predefinedKeys.includes(key)\n )\n .flatMap(([key, value]) => {\n if (key === 'gpu_idx' && Array.isArray(value)) {\n return `--gpu-idx ${value.join(',')}`\n } else if (key === 'peft_model_config' && typeof value === 'object') {\n const peftArgs = []\n if (value.lora_list) {\n peftArgs.push(\n ...value.lora_list.map(\n (lora) => `--lora-modules ${lora.lora_name} ${lora.local_path}`\n )\n )\n }\n if (value.image_lora_load_kwargs) {\n peftArgs.push(\n ...Object.entries(value.image_lora_load_kwargs).map(\n ([k, v]) => `--image-lora-load-kwargs ${k} ${v}`\n )\n )\n }\n if (value.image_lora_fuse_kwargs) {\n peftArgs.push(\n ...Object.entries(value.image_lora_fuse_kwargs).map(\n ([k, v]) => `--image-lora-fuse-kwargs ${k} ${v}`\n )\n )\n }\n return peftArgs\n } else if (key === 'quantization_config' && typeof value === 'object') {\n return Object.entries(value).map(\n ([k, v]) => `--quantization-config ${k} ${v === null ? 'none' : v}`\n )\n } else if (key === 'envs' && typeof value === 'object') {\n return Object.entries(value).map(([k, v]) => `--env ${k} ${v}`)\n } else if (key === 'virtual_env_packages' && Array.isArray(value)) {\n return value.map((pkg) => `--virtual-env-package ${pkg}`)\n } else if (key === 'enable_virtual_env') {\n if (value === true) return `--enable-virtual-env`\n if (value === false) return `--disable-virtual-env`\n return []\n } else if (predefinedKeys.includes(key)) {\n const newKey = keyMap[key] ?? `--${key.replace(/_/g, '-')}`\n return `${newKey} ${\n value === false ? 'false' : value === null ? 'none' : value\n }`\n } else {\n return `--${key} ${\n value === false ? 'false' : value === null ? 'none' : value\n }`\n }\n })\n .join(' ')\n\n return `xinference launch ${args}`\n }\n\n useEffect(() => {\n const text = generateCommandLineStatement(modelData)\n const clipboard = new ClipboardJS(copyRef.current, {\n text: () => text,\n })\n\n clipboard.on('success', (e) => {\n e.clearSelection()\n setIsCopySuccess(true)\n })\n\n const handleClick = (event) => {\n event.stopPropagation()\n copyRef.current.focus()\n }\n\n const copy = copyRef.current\n copy.addEventListener('click', handleClick)\n\n return () => {\n clipboard.destroy()\n copy.removeEventListener('click', handleClick)\n }\n }, [modelData])\n\n return (\n <div style={{ marginInline: '10px', lineHeight: '14px' }}>\n <Tooltip title={t('launchModel.copyToCommandLine')} placement=\"top\">\n <div ref={copyRef}>\n <FilterNoneIcon className=\"copyToCommandLine\" />\n </div>\n </Tooltip>\n <Snackbar\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n open={isCopySuccess}\n autoHideDuration={1500}\n onClose={() => setIsCopySuccess(false)}\n >\n <Alert severity=\"success\" variant=\"filled\" sx={{ width: '100%' }}>\n {t('components.copySuccess')}\n </Alert>\n </Snackbar>\n </div>\n )\n}\n\nexport default CopyComponent\n"],"mappings":"wSAAA,MAAO,CAAAA,cAAc,KAAM,gCAAgC,CAC3D,OAASC,KAAK,CAAEC,QAAQ,CAAEC,OAAO,KAAQ,eAAe,CACxD,MAAO,CAAAC,WAAW,KAAM,WAAW,CACnC,MAAO,CAAAC,KAAK,EAAIC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CAC1D,OAASC,cAAc,KAAQ,eAAe,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAE9C,GAAM,CAAAC,MAAM,CAAG,CACbC,sBAAsB,CAAE,oBAAoB,CAC5CC,YAAY,CAAE,gBAAgB,CAC9BC,eAAe,CAAE,mBAAmB,CACpCC,iBAAiB,CAAE,qBACrB,CAAC,CAED,QAAS,CAAAC,aAAaA,CAAAC,IAAA,CAAgC,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,CAAE,MAAO,CAAE,CAAAC,QAAA,eACvDjF,IAAA,CAACR,OAAO,EAAC0F,KAAK,CAAErE,CAAC,CAAC,+BAA+B,CAAE,CAACsE,SAAS,CAAC,KAAK,CAAAF,QAAA,cACjEjF,IAAA,QAAKoF,GAAG,CAAEjE,OAAQ,CAAA8D,QAAA,cAChBjF,IAAA,CAACX,cAAc,EAACgG,SAAS,CAAC,mBAAmB,CAAE,CAAC,CAC7C,CAAC,CACC,CAAC,cACVrF,IAAA,CAACT,QAAQ,EACP+F,YAAY,CAAE,CAAEC,QAAQ,CAAE,KAAK,CAAEC,UAAU,CAAE,QAAS,CAAE,CACxDC,IAAI,CAAExE,aAAc,CACpByE,gBAAgB,CAAE,IAAK,CACvBC,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAAzE,gBAAgB,CAAC,KAAK,CAAC,EAAC,CAAA+D,QAAA,cAEvCjF,IAAA,CAACV,KAAK,EAACsG,QAAQ,CAAC,SAAS,CAACC,OAAO,CAAC,QAAQ,CAACC,EAAE,CAAE,CAAEC,KAAK,CAAE,MAAO,CAAE,CAAAd,QAAA,CAC9DpE,CAAC,CAAC,wBAAwB,CAAC,CACvB,CAAC,CACA,CAAC,EACR,CAAC,CAEV,CAEA,cAAe,CAAAL,aAAa","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"export var llmAllDataKey=['model_uid','model_name','model_type','model_engine','model_format','model_size_in_billions','quantization','n_worker','n_gpu','n_gpu_layers','replica','request_limits','worker_ip','gpu_idx','download_hub','model_path','reasoning_content','gguf_quantization','gguf_model_path','cpu_offload','peft_model_config','quantization_config','enable_thinking','multimodal_projectors','enable_virtual_env','virtual_env_packages','envs'];export var additionalParameterTipList={'transformers':['torch_dtype','device','enable_flash_attn'],'llama.cpp':['n_ctx','use_mmap','use_mlock'],'vllm':['block_size','gpu_memory_utilization','max_num_seqs','max_model_len','guided_decoding_backend','scheduling_policy','tensor_parallel_size','pipeline_parallel_size','enable_prefix_caching','enable_chunked_prefill','enforce_eager','cpu_offload_gb','disable_custom_all_reduce','limit_mm_per_prompt','model_quantization','mm_processor_kwargs','min_pixels','max_pixels'],'sglang':['mem_fraction_static','attention_reduce_in_fp32','tp_size','dp_size','chunked_prefill_size','cpu_offload_gb','enable_dp_attention','enable_ep_moe'],'mlx':['cache_limit_gb','max_kv_size']};export var quantizationParametersTipList=['load_in_8bit','load_in_4bit','llm_int8_threshold','llm_int8_skip_modules','llm_int8_enable_fp32_cpu_offload','llm_int8_has_fp16_weight','bnb_4bit_compute_dtype','bnb_4bit_quant_type','bnb_4bit_use_double_quant','bnb_4bit_quant_storage'];export var featureModels=[{type:'llm',feature_models:['gpt-oss','qwen3','Ernie4.5','deepseek-v3-0324','deepseek-r1-0528','deepseek-r1-0528-qwen3','qwen2.5-vl-instruct','glm4-0414','QwQ-32B','gemma-3-it']},{type:'embedding',feature_models:['Qwen3-Embedding-0.6B','Qwen3-Embedding-4B','Qwen3-Embedding-8B','bge-large-zh-v1.5','bge-large-en-v1.5','bge-m3','gte-Qwen2','jina-embeddings-v3']},{type:'rerank',feature_models:[]},{type:'image',feature_models:['Qwen-Image','FLUX.1-dev','FLUX.1-Kontext-dev','FLUX.1-schnell','sd3.5-large','HunyuanDiT-v1.2','cogview4','sd3.5-medium']},{type:'audio',feature_models:['CosyVoice2-0.5B','FishSpeech-1.5','F5-TTS','ChatTTS','SenseVoiceSmall','whisper-large-v3']},{type:'video',feature_models:[]}];","map":{"version":3,"names":["llmAllDataKey","additionalParameterTipList","quantizationParametersTipList","featureModels","type","feature_models"],"sources":["/home/runner/work/inference/inference/xinference/ui/web/ui/src/scenes/launch_model/data/data.js"],"sourcesContent":["export const llmAllDataKey = [\n 'model_uid',\n 'model_name',\n 'model_type',\n 'model_engine',\n 'model_format',\n 'model_size_in_billions',\n 'quantization',\n 'n_worker',\n 'n_gpu',\n 'n_gpu_layers',\n 'replica',\n 'request_limits',\n 'worker_ip',\n 'gpu_idx',\n 'download_hub',\n 'model_path',\n 'reasoning_content',\n 'gguf_quantization',\n 'gguf_model_path',\n 'cpu_offload',\n 'peft_model_config',\n 'quantization_config',\n 'enable_thinking',\n 'multimodal_projectors',\n 'enable_virtual_env',\n 'virtual_env_packages',\n 'envs',\n]\n\nexport const additionalParameterTipList = {\n 'transformers': ['torch_dtype', 'device', 'enable_flash_attn'],\n 'llama.cpp': ['n_ctx', 'use_mmap', 'use_mlock'],\n 'vllm': [\n 'block_size',\n 'gpu_memory_utilization',\n 'max_num_seqs',\n 'max_model_len',\n 'guided_decoding_backend',\n 'scheduling_policy',\n 'tensor_parallel_size',\n 'pipeline_parallel_size',\n 'enable_prefix_caching',\n 'enable_chunked_prefill',\n 'enforce_eager',\n 'cpu_offload_gb',\n 'disable_custom_all_reduce',\n 'limit_mm_per_prompt',\n 'model_quantization',\n 'mm_processor_kwargs',\n 'min_pixels',\n 'max_pixels',\n ],\n 'sglang': [\n 'mem_fraction_static',\n 'attention_reduce_in_fp32',\n 'tp_size',\n 'dp_size',\n 'chunked_prefill_size',\n 'cpu_offload_gb',\n 'enable_dp_attention',\n 'enable_ep_moe',\n ],\n 'mlx': ['cache_limit_gb', 'max_kv_size'],\n}\n\nexport const quantizationParametersTipList = [\n 'load_in_8bit',\n 'load_in_4bit',\n 'llm_int8_threshold',\n 'llm_int8_skip_modules',\n 'llm_int8_enable_fp32_cpu_offload',\n 'llm_int8_has_fp16_weight',\n 'bnb_4bit_compute_dtype',\n 'bnb_4bit_quant_type',\n 'bnb_4bit_use_double_quant',\n 'bnb_4bit_quant_storage',\n]\n\nexport const featureModels = [\n {\n type: 'llm',\n feature_models: [\n 'gpt-oss',\n 'qwen3',\n 'Ernie4.5',\n 'deepseek-v3-0324',\n 'deepseek-r1-0528',\n 'deepseek-r1-0528-qwen3',\n 'qwen2.5-vl-instruct',\n 'glm4-0414',\n 'QwQ-32B',\n 'gemma-3-it',\n ],\n },\n {\n type: 'embedding',\n feature_models: [\n 'Qwen3-Embedding-0.6B',\n 'Qwen3-Embedding-4B',\n 'Qwen3-Embedding-8B',\n 'bge-large-zh-v1.5',\n 'bge-large-en-v1.5',\n 'bge-m3',\n 'gte-Qwen2',\n 'jina-embeddings-v3',\n ],\n },\n {\n type: 'rerank',\n feature_models: [],\n },\n {\n type: 'image',\n feature_models: [\n 'Qwen-Image',\n 'FLUX.1-dev',\n 'FLUX.1-Kontext-dev',\n 'FLUX.1-schnell',\n 'sd3.5-large',\n 'HunyuanDiT-v1.2',\n 'cogview4',\n 'sd3.5-medium',\n ],\n },\n {\n type: 'audio',\n feature_models: [\n 'CosyVoice2-0.5B',\n 'FishSpeech-1.5',\n 'F5-TTS',\n 'ChatTTS',\n 'SenseVoiceSmall',\n 'whisper-large-v3',\n ],\n },\n {\n type: 'video',\n feature_models: [],\n },\n]\n"],"mappings":"AAAA,MAAO,IAAM,CAAAA,aAAa,CAAG,CAC3B,WAAW,CACX,YAAY,CACZ,YAAY,CACZ,cAAc,CACd,cAAc,CACd,wBAAwB,CACxB,cAAc,CACd,UAAU,CACV,OAAO,CACP,cAAc,CACd,SAAS,CACT,gBAAgB,CAChB,WAAW,CACX,SAAS,CACT,cAAc,CACd,YAAY,CACZ,mBAAmB,CACnB,mBAAmB,CACnB,iBAAiB,CACjB,aAAa,CACb,mBAAmB,CACnB,qBAAqB,CACrB,iBAAiB,CACjB,uBAAuB,CACvB,oBAAoB,CACpB,sBAAsB,CACtB,MAAM,CACP,CAED,MAAO,IAAM,CAAAC,0BAA0B,CAAG,CACxC,cAAc,CAAE,CAAC,aAAa,CAAE,QAAQ,CAAE,mBAAmB,CAAC,CAC9D,WAAW,CAAE,CAAC,OAAO,CAAE,UAAU,CAAE,WAAW,CAAC,CAC/C,MAAM,CAAE,CACN,YAAY,CACZ,wBAAwB,CACxB,cAAc,CACd,eAAe,CACf,yBAAyB,CACzB,mBAAmB,CACnB,sBAAsB,CACtB,wBAAwB,CACxB,uBAAuB,CACvB,wBAA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ACD,CACED,IAAI,CAAE,OAAO,CACbC,cAAc,CAAE,EAClB,CAAC,CACF","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ast":null,"code":"import _slicedToArray from\"/home/runner/work/inference/inference/xinference/ui/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Tab}from'@mui/material';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useTranslation}from'react-i18next';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetchWrapper from'../../components/fetchWrapper';import SuccessMessageSnackBar from'../../components/successMessageSnackBar';import Title from'../../components/Title';import{isValidBearerToken}from'../../components/utils';import{featureModels}from'./data/data';import LaunchCustom from'./launchCustom';import LaunchModelComponent from'./LaunchModel';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(sessionStorage.getItem('modelType')?sessionStorage.getItem('modelType'):'/launch_model/llm'),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var _useState=useState(-1),_useState2=_slicedToArray(_useState,2),gpuAvailable=_useState2[0],setGPUAvailable=_useState2[1];var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var _useTranslation=useTranslation(),t=_useTranslation.t;var handleTabChange=function handleTabChange(event,newValue){setValue(newValue);navigate(newValue);sessionStorage.setItem('modelType',newValue);newValue==='/launch_model/custom/llm'?sessionStorage.setItem('subType',newValue):'';};useEffect(function(){if(sessionStorage.getItem('auth')==='true'&&!isValidBearerToken(sessionStorage.getItem('token'))&&!isValidBearerToken(cookie.token)){navigate('/login',{replace:true});}if(gpuAvailable===-1){fetchWrapper.get('/v1/cluster/devices').then(function(data){return setGPUAvailable(parseInt(data,10));}).catch(function(error){console.error('Error:',error);if(error.response.status!==403&&error.response.status!==401){setErrorMsg(error.message);}});}},[cookie.token]);return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:t('menu.launchModel')}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsx(SuccessMessageSnackBar,{}),/*#__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:t('model.languageModels'),value:\"/launch_model/llm\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.embeddingModels'),value:\"/launch_model/embedding\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.rerankModels'),value:\"/launch_model/rerank\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.imageModels'),value:\"/launch_model/image\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.audioModels'),value:\"/launch_model/audio\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.videoModels'),value:\"/launch_model/video\"}),/*#__PURE__*/_jsx(Tab,{label:t('model.customModels'),value:\"/launch_model/custom/llm\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'LLM',gpuAvailable:gpuAvailable,featureModels:featureModels.find(function(item){return item.type==='llm';}).feature_models})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/embedding\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'embedding',gpuAvailable:gpuAvailable,featureModels:featureModels.find(function(item){return item.type==='embedding';}).feature_models})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/rerank\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'rerank',gpuAvailable:gpuAvailable,featureModels:featureModels.find(function(item){return item.type==='rerank';}).feature_models})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/image\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'image',featureModels:featureModels.find(function(item){return item.type==='image';}).feature_models})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/audio\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'audio',featureModels:featureModels.find(function(item){return item.type==='audio';}).feature_models})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/video\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchModelComponent,{modelType:'video',featureModels:featureModels.find(function(item){return item.type==='video';}).feature_models})}),/*#__PURE__*/_jsx(TabPanel,{value:\"/launch_model/custom/llm\",sx:{padding:0},children:/*#__PURE__*/_jsx(LaunchCustom,{gpuAvailable:gpuAvailable})})]})]});};export default LaunchModel;","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Tab","React","useContext","useEffect","useState","useCookies","useTranslation","useNavigate","ApiContext","ErrorMessageSnackBar","fetchWrapper","SuccessMessageSnackBar","Title","isValidBearerToken","featureModels","LaunchCustom","LaunchModelComponent","jsx","_jsx","jsxs","_jsxs","LaunchModel","_React$useState","sessionStorage","getItem","_React$useState2","_slicedToArray","value","setValue","_useState","_useState2","gpuAvailable","setGPUAvailable","_useContext","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","_useTranslation","t","handleTabChange","event","newValue","setItem","token","replace","get","then","data","parseInt","catch","error","console","response","status","message","m","children","title","sx","borderBottom","borderColor","onChange","label","padding","modelType","find","item","type","feature_models"],"sources":["/home/runner/work/inference/inference/xinference/ui/web/ui/src/scenes/launch_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Tab } from '@mui/material'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useTranslation } from 'react-i18next'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetchWrapper from '../../components/fetchWrapper'\nimport SuccessMessageSnackBar from '../../components/successMessageSnackBar'\nimport Title from '../../components/Title'\nimport { isValidBearerToken } from '../../components/utils'\nimport { featureModels } from './data/data'\nimport LaunchCustom from './launchCustom'\nimport LaunchModelComponent from './LaunchModel'\n\nconst LaunchModel = () => {\n const [value, setValue] = React.useState(\n sessionStorage.getItem('modelType')\n ? sessionStorage.getItem('modelType')\n : '/launch_model/llm'\n )\n const [gpuAvailable, setGPUAvailable] = useState(-1)\n\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n const { t } = useTranslation()\n\n const handleTabChange = (event, newValue) => {\n setValue(newValue)\n navigate(newValue)\n sessionStorage.setItem('modelType', newValue)\n newValue === '/launch_model/custom/llm'\n ? sessionStorage.setItem('subType', newValue)\n : ''\n }\n\n useEffect(() => {\n if (\n sessionStorage.getItem('auth') === 'true' &&\n !isValidBearerToken(sessionStorage.getItem('token')) &&\n !isValidBearerToken(cookie.token)\n ) {\n navigate('/login', { replace: true })\n }\n\n if (gpuAvailable === -1) {\n fetchWrapper\n .get('/v1/cluster/devices')\n .then((data) => setGPUAvailable(parseInt(data, 10)))\n .catch((error) => {\n console.error('Error:', error)\n if (error.response.status !== 403 && error.response.status !== 401) {\n setErrorMsg(error.message)\n }\n })\n }\n }, [cookie.token])\n\n return (\n <Box m=\"20px\">\n <Title title={t('menu.launchModel')} />\n <ErrorMessageSnackBar />\n <SuccessMessageSnackBar />\n <TabContext value={value}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList value={value} onChange={handleTabChange} aria-label=\"tabs\">\n <Tab label={t('model.languageModels')} value=\"/launch_model/llm\" />\n <Tab\n label={t('model.embeddingModels')}\n value=\"/launch_model/embedding\"\n />\n <Tab label={t('model.rerankModels')} value=\"/launch_model/rerank\" />\n <Tab label={t('model.imageModels')} value=\"/launch_model/image\" />\n <Tab label={t('model.audioModels')} value=\"/launch_model/audio\" />\n <Tab label={t('model.videoModels')} value=\"/launch_model/video\" />\n <Tab\n label={t('model.customModels')}\n value=\"/launch_model/custom/llm\"\n />\n </TabList>\n </Box>\n <TabPanel value=\"/launch_model/llm\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'LLM'}\n gpuAvailable={gpuAvailable}\n featureModels={\n featureModels.find((item) => item.type === 'llm').feature_models\n }\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/embedding\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'embedding'}\n gpuAvailable={gpuAvailable}\n featureModels={\n featureModels.find((item) => item.type === 'embedding')\n .feature_models\n }\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/rerank\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'rerank'}\n gpuAvailable={gpuAvailable}\n featureModels={\n featureModels.find((item) => item.type === 'rerank')\n .feature_models\n }\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/image\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'image'}\n featureModels={\n featureModels.find((item) => item.type === 'image').feature_models\n }\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/audio\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'audio'}\n featureModels={\n featureModels.find((item) => item.type === 'audio').feature_models\n }\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/video\" sx={{ padding: 0 }}>\n <LaunchModelComponent\n modelType={'video'}\n featureModels={\n featureModels.find((item) => item.type === 'video').feature_models\n }\n />\n </TabPanel>\n <TabPanel value=\"/launch_model/custom/llm\" sx={{ padding: 0 }}>\n <LaunchCustom gpuAvailable={gpuAvailable} />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default LaunchMod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