chore: filter gguf files when importing model on windows (#2653)
Co-authored-by: Louis <louis@jan.ai>
This commit is contained in:
parent
d5c4f745f1
commit
c0c038f4f7
@ -13,6 +13,13 @@ export type SelectFileOption = {
|
|||||||
selectDirectory?: boolean
|
selectDirectory?: boolean
|
||||||
|
|
||||||
props?: SelectFileProp[]
|
props?: SelectFileProp[]
|
||||||
|
|
||||||
|
filters?: FilterOption[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type FilterOption = {
|
||||||
|
name: string
|
||||||
|
extensions: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SelectFilePropTuple = [
|
export const SelectFilePropTuple = [
|
||||||
|
|||||||
@ -112,6 +112,7 @@ export function handleAppIPCs() {
|
|||||||
title,
|
title,
|
||||||
buttonLabel,
|
buttonLabel,
|
||||||
properties: props,
|
properties: props,
|
||||||
|
filters: option?.filters,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (canceled) return
|
if (canceled) return
|
||||||
|
|||||||
@ -25,6 +25,10 @@ const ChooseWhatToImportModal: React.FC = () => {
|
|||||||
title: 'Select model files',
|
title: 'Select model files',
|
||||||
buttonLabel: 'Select',
|
buttonLabel: 'Select',
|
||||||
allowMultiple: true,
|
allowMultiple: true,
|
||||||
|
filters: [
|
||||||
|
{ name: 'GGUF Files', extensions: ['gguf'] },
|
||||||
|
{ name: 'All Files', extensions: ['*'] },
|
||||||
|
],
|
||||||
}
|
}
|
||||||
const filePaths = await window.core?.api?.selectFiles(options)
|
const filePaths = await window.core?.api?.selectFiles(options)
|
||||||
if (!filePaths || filePaths.length === 0) return
|
if (!filePaths || filePaths.length === 0) return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user