fix: handle modelId special char
This commit is contained in:
parent
985a8f31ae
commit
b338849952
@ -287,8 +287,8 @@ function Hub() {
|
|||||||
|
|
||||||
const handleDownload = () => {
|
const handleDownload = () => {
|
||||||
// Immediately set local downloading state
|
// Immediately set local downloading state
|
||||||
addLocalDownloadingModel(modelId)
|
addLocalDownloadingModel(modelId.replace(/[^a-zA-Z0-9/_\-.]/g, ''))
|
||||||
pullModel(modelId, modelUrl)
|
pullModel(modelId.replace(/[^a-zA-Z0-9/_\-.]/g, ''), modelUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -162,7 +162,9 @@ export const convertHfRepoToCatalogModel = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate model_id from filename (remove .gguf extension, case-insensitive)
|
// Generate model_id from filename (remove .gguf extension, case-insensitive)
|
||||||
const modelId = file.rfilename.replace(/\.gguf$/i, '')
|
const modelId = file.rfilename
|
||||||
|
.replace(/\.gguf$/i, '')
|
||||||
|
.replace(/[^a-zA-Z0-9/_\-.]/g, '')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
model_id: modelId,
|
model_id: modelId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user