common : respect specified tag, only fallback when tag is empty (#21413)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
@@ -596,11 +596,14 @@ static hf_cache::hf_file find_best_model(const hf_cache::hf_files & files,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fallback to first available model only if tag is empty
|
||||||
|
if (tag.empty()) {
|
||||||
for (const auto & f : files) {
|
for (const auto & f : files) {
|
||||||
if (gguf_filename_is_model(f.path)) {
|
if (gguf_filename_is_model(f.path)) {
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user