Skip to content

Commit 2d2d9c2

Browse files
authored
common : add a WARNING for HF cache migration (ggml-org#20935)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 92080b4 commit 2d2d9c2

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ LLM inference in C/C++
1717

1818
## Hot topics
1919

20+
- **HuggingFace cache migration: models downloaded with `-hf` are now stored in the standard HuggingFace cache directory, enabling sharing with other HF tools.**
2021
- **[guide : using the new WebUI of llama.cpp](https://github.com/ggml-org/llama.cpp/discussions/16938)**
2122
- [guide : running gpt-oss with llama.cpp](https://github.com/ggml-org/llama.cpp/discussions/15396)
2223
- [[FEEDBACK] Better packaging for llama.cpp to support downstream consumers 🤗](https://github.com/ggml-org/llama.cpp/discussions/15313)

common/hf-cache.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ void migrate_old_cache_to_hf_cache(const std::string & token, bool offline) {
590590
return; // -hf is not going to work
591591
}
592592

593+
bool warned = false;
594+
593595
for (const auto & entry : fs::directory_iterator(old_cache)) {
594596
if (!entry.is_regular_file()) {
595597
continue;
@@ -601,6 +603,19 @@ void migrate_old_cache_to_hf_cache(const std::string & token, bool offline) {
601603
continue;
602604
}
603605

606+
if (!warned) {
607+
warned = true;
608+
LOG_WRN("================================================================================\n"
609+
"WARNING: Migrating cache to HuggingFace cache directory\n"
610+
" Old cache: %s\n"
611+
" New cache: %s\n"
612+
"This one-time migration moves models previously downloaded with -hf\n"
613+
"from the legacy llama.cpp cache to the standard HuggingFace cache.\n"
614+
"Models downloaded with --model-url are not affected.\n"
615+
"================================================================================\n",
616+
old_cache.string().c_str(), get_cache_directory().string().c_str());
617+
}
618+
604619
auto repo_id = owner + "/" + repo;
605620
auto files = get_repo_files(repo_id, token);
606621

0 commit comments

Comments
 (0)