char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Xuan-Son Nguyenserver: (router) add model management API (#23976)4b4d13ae7

char/aliceai-t5-moe
775 B35 linesraw
1#pragma once
2
3#include <string>
4#include <vector>
5
6// Ref: https://huggingface.co/docs/hub/local-cache.md
7
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 API
22hf_files get_repo_files(
23    const std::string & repo_id,
24    const std::string & token
25);
26
27hf_files get_cached_files(const std::string & repo_id = {});
28
29// Create snapshot path (link or move/copy) and return it
30std::string finalize_file(const hf_file & file);
31
32// Remove the entire cached directory for a repo, returns true if removed
33bool remove_cached_repo(const std::string & repo_id);
34
35} // namespace hf_cache