diff --git a/xinference/web/ui/src/scenes/launch_model/modelCard.js b/xinference/web/ui/src/scenes/launch_model/modelCard.js index f231d5827d..56dc93b8be 100644 --- a/xinference/web/ui/src/scenes/launch_model/modelCard.js +++ b/xinference/web/ui/src/scenes/launch_model/modelCard.js @@ -69,6 +69,7 @@ const llmAllDataKey = [ 'request_limits', 'worker_ip', 'gpu_idx', + 'download_hub', 'peft_model_config', ] @@ -107,6 +108,7 @@ const ModelCard = ({ const [requestLimits, setRequestLimits] = useState('') const [workerIp, setWorkerIp] = useState('') const [GPUIdx, setGPUIdx] = useState('') + const [downloadHub, setDownloadHub] = useState('') const [enginesObj, setEnginesObj] = useState({}) const [engineOptions, setEngineOptions] = useState([]) @@ -298,12 +300,14 @@ const ModelCard = ({ : Number(String(requestLimits).trim()), worker_ip: workerIp.trim() === '' ? null : workerIp.trim(), gpu_idx: GPUIdx.trim() === '' ? null : handleGPUIdx(GPUIdx.trim()), + download_hub: downloadHub === '' ? null : downloadHub, } let modelDataWithID_other = { model_uid: modelUID.trim() === '' ? null : modelUID.trim(), model_name: modelData.model_name, model_type: modelType, + download_hub: downloadHub === '' ? null : downloadHub, } if (modelType === 'embedding' || modelType === 'rerank') { @@ -359,6 +363,8 @@ const ModelCard = ({ const modelDataWithID = modelType === 'LLM' ? modelDataWithID_LLM : modelDataWithID_other + console.log('modelDataWithID----', modelDataWithID); + // First fetcher request to initiate the model fetchWrapper .post('/v1/models', modelDataWithID) @@ -552,6 +558,7 @@ const ModelCard = ({ request_limits, worker_ip, gpu_idx, + download_hub, peft_model_config, } = arr[0] @@ -574,6 +581,7 @@ const ModelCard = ({ setRequestLimits(request_limits || '') setWorkerIp(worker_ip || '') setGPUIdx(gpu_idx?.join(',') || '') + setDownloadHub(download_hub || '') let loraData = [] peft_model_config?.lora_list?.forEach((item) => { @@ -609,7 +617,7 @@ const ModelCard = ({ } setCustomArr(customData) - if (model_uid || request_limits || worker_ip || gpu_idx?.join(',')) + if (model_uid || request_limits || worker_ip || gpu_idx?.join(',') || download_hub) setIsOther(true) if ( @@ -633,6 +641,7 @@ const ModelCard = ({ } else { setModelUID(arr[0].model_uid || '') } + setDownloadHub(arr[0].download_hub) } } @@ -1336,11 +1345,34 @@ const ModelCard = ({ )} + + + + (Optional) Download_hub + + setDownloadHub(e.target.value)} + label="(Optional) Download_hub" + > + {["huggingface", "modelscope", "csghub"].map(item => { + return ( + + {item} + + ) + })} + + + setIsPeftModelConfig(!isPeftModelConfig)} > - + + {isPeftModelConfig ? : } + > )} + + + (Optional) Download_hub + + setDownloadHub(e.target.value)} + label="(Optional) Download_hub" + > + {["huggingface", "modelscope"].map(item => { + return ( + + {item} + + ) + })} + + )}