fix: keep the source deploying from files
This commit is contained in:
@@ -121,6 +121,28 @@ const ModelFiles = () => {
|
|||||||
return isGGUF || isOllama;
|
return isGGUF || isOllama;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getModelInfo = (record: ListItem) => {
|
||||||
|
if (record.source === modelSourceMap.huggingface_value) {
|
||||||
|
return {
|
||||||
|
source: modelSourceMap.huggingface_value,
|
||||||
|
huggingface_repo_id: record.huggingface_repo_id,
|
||||||
|
huggingface_filename: record.huggingface_filename
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (record.source === modelSourceMap.modelscope_value) {
|
||||||
|
return {
|
||||||
|
source: modelSourceMap.modelscope_value,
|
||||||
|
model_scope_model_id: record.model_scope_model_id,
|
||||||
|
model_scope_file_path: record.model_scope_file_path
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
source: modelSourceMap.local_path_value,
|
||||||
|
local_path: record.resolved_paths?.[0]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const generateInitialValues = (record: ListItem, gpuOptions: any[]) => {
|
const generateInitialValues = (record: ListItem, gpuOptions: any[]) => {
|
||||||
const isGGUF = checkIsGGUF(record);
|
const isGGUF = checkIsGGUF(record);
|
||||||
const audioModelTag = identifyModelTask(
|
const audioModelTag = identifyModelTask(
|
||||||
@@ -146,8 +168,7 @@ const ModelFiles = () => {
|
|||||||
cluster_id: workersList?.find(
|
cluster_id: workersList?.find(
|
||||||
(worker) => worker.value === record.worker_id
|
(worker) => worker.value === record.worker_id
|
||||||
)?.cluster_id,
|
)?.cluster_id,
|
||||||
source: modelSourceMap.local_path_value,
|
...getModelInfo(record),
|
||||||
local_path: record.resolved_paths?.[0],
|
|
||||||
worker_selector: targetWorker
|
worker_selector: targetWorker
|
||||||
? {
|
? {
|
||||||
'worker-name': targetWorker
|
'worker-name': targetWorker
|
||||||
|
|||||||
Reference in New Issue
Block a user