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:
Yaroslav98214 authored and GitHub committed 2026-02-05 10:17:46 +01:00
1 parent c30866ba95
commit 6dbcdb0b9e
2 files changed
+4

No files matched your search

+2
View File
@@ -120,6 +120,8 @@ var knownModelsNameSuffixToSkip []string = []string{
".",
".safetensors",
".bin",
".gguf",
".ggml",
".partial",
".tar.gz",
}
+2
View File
@@ -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"))
})
})