Skip to content

Commit d01f627

Browse files
authored
common : respect specified tag, only fallback when tag is empty (#21413)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 650bf14 commit d01f627

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

common/download.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,12 @@ static hf_cache::hf_file find_best_model(const hf_cache::hf_files & files,
596596
}
597597
}
598598

599-
for (const auto & f : files) {
600-
if (gguf_filename_is_model(f.path)) {
601-
return f;
599+
// fallback to first available model only if tag is empty
600+
if (tag.empty()) {
601+
for (const auto & f : files) {
602+
if (gguf_filename_is_model(f.path)) {
603+
return f;
604+
}
602605
}
603606
}
604607

0 commit comments

Comments
 (0)