mirror of
https://github.com/mudler/LocalAI.git
synced 2026-02-05 12:12:39 -05:00
fix: filter GGUF and GGML files from model list (#8397)
Filter GGUF and GGML files from model list Skip .gguf/.ggml loose files when listing models and add a test for .gguf exclusion. Closes #1077 Signed-off-by: Yaroslav98214 <diakovichyaroslav30@gmail.com>
This commit is contained in:
@@ -120,6 +120,8 @@ var knownModelsNameSuffixToSkip []string = []string{
|
||||
".",
|
||||
".safetensors",
|
||||
".bin",
|
||||
".gguf",
|
||||
".ggml",
|
||||
".partial",
|
||||
".tar.gz",
|
||||
}
|
||||
|
||||
@@ -61,11 +61,13 @@ var _ = Describe("ModelLoader", func() {
|
||||
Context("ListFilesInModelPath", func() {
|
||||
It("should list all valid model files in the model path", func() {
|
||||
os.Create(filepath.Join(modelPath, "test.model"))
|
||||
os.Create(filepath.Join(modelPath, "model.gguf"))
|
||||
os.Create(filepath.Join(modelPath, "README.md"))
|
||||
|
||||
files, err := modelLoader.ListFilesInModelPath()
|
||||
Expect(err).To(BeNil())
|
||||
Expect(files).To(ContainElement("test.model"))
|
||||
Expect(files).ToNot(ContainElement("model.gguf"))
|
||||
Expect(files).ToNot(ContainElement("README.md"))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user