Skip to content

Commit f2c72b8

Browse files
authored
common : fix gguf selection in common_list_cached_models (#20996)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent ec54ac1 commit f2c72b8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

common/download.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,9 @@ static gguf_split_info get_gguf_split_info(const std::string & path) {
454454
std::smatch m;
455455

456456
std::string prefix = path;
457-
string_remove_suffix(prefix, ".gguf");
457+
if (!string_remove_suffix(prefix, ".gguf")) {
458+
return {};
459+
}
458460

459461
int index = 1;
460462
int count = 1;

0 commit comments

Comments
 (0)