Merge pull request #5045 from menloresearch/chore/import-model-filename

chore: show model name as filename
This commit is contained in:
Faisal Amir 2025-05-20 23:45:18 +07:00 committed by GitHub
commit b0a55d63f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,7 +194,7 @@ export const importModel = async (
if (!path) throw new Error('No file selected') if (!path) throw new Error('No file selected')
// Extract filename from path to use as model ID if not provided // Extract filename from path to use as model ID if not provided
const defaultModelId = path.split('/').pop()?.split('.')[0] || path const defaultModelId = path.split('/').pop()?.replace(/ /g, '-') || path
const modelIdToUse = modelId || defaultModelId const modelIdToUse = modelId || defaultModelId
return await extension.importModel(modelIdToUse, path, provider) return await extension.importModel(modelIdToUse, path, provider)