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
|
||||
|
||||
props?: SelectFileProp[]
|
||||
|
||||
filters?: FilterOption[]
|
||||
}
|
||||
|
||||
export type FilterOption = {
|
||||
name: string
|
||||
extensions: string[]
|
||||
}
|
||||
|
||||
export const SelectFilePropTuple = [
|
||||
|
||||
@ -112,6 +112,7 @@ export function handleAppIPCs() {
|
||||
title,
|
||||
buttonLabel,
|
||||
properties: props,
|
||||
filters: option?.filters,
|
||||
})
|
||||
|
||||
if (canceled) return
|
||||
|
||||
@ -25,6 +25,10 @@ const ChooseWhatToImportModal: React.FC = () => {
|
||||
title: 'Select model files',
|
||||
buttonLabel: 'Select',
|
||||
allowMultiple: true,
|
||||
filters: [
|
||||
{ name: 'GGUF Files', extensions: ['gguf'] },
|
||||
{ name: 'All Files', extensions: ['*'] },
|
||||
],
|
||||
}
|
||||
const filePaths = await window.core?.api?.selectFiles(options)
|
||||
if (!filePaths || filePaths.length === 0) return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user