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