Felipe97/llama-cpp-compiled
01.1k
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};18 19using hf_files = std::vector<hf_file>;20 21// Get files from HF API22hf_files get_repo_files(23 const std::string & repo_id,24 const std::string & token25);26 27hf_files get_cached_files(const std::string & repo_id = {});28 29// Create snapshot path (link or move/copy) and return it30std::string finalize_file(const hf_file & file);31 32// Remove the entire cached directory for a repo, returns true if removed33bool remove_cached_repo(const std::string & repo_id);34 35// Returns the HuggingFace hub cache path36std::string get_cache_path();37 38} // namespace hf_cache39 