echodict/llama.cpp
version https://git-lfs.github.com/spec/v1 oid sha256:cfc44b7ba25614df70e6b65e3341cae0310163bd32fd31a6b928a542df433faf size 30786
0479
1#pragma once2 3#include <string>4#include <vector>5 6// Ref: https://huggingface.co/docs/hub/local-cache.md7 8namespace hf_cache {9 10struct hf_file {11 std::string path;12 std::string url;13 std::string local_path;14 std::string final_path;15 std::string oid;16 std::string repo_id;17 size_t size = 0; // only for the migration18};19 20using hf_files = std::vector<hf_file>;21 22// Get files from HF API23hf_files get_repo_files(24 const std::string & repo_id,25 const std::string & token26);27 28hf_files get_cached_files(const std::string & repo_id = {});29 30// Create snapshot path (link or move/copy) and return it31std::string finalize_file(const hf_file & file);32 33// TODO: Remove later34void migrate_old_cache_to_hf_cache(const std::string & token, bool offline = false);35 36} // namespace hf_cache37 