From 8d61ff45306a35ae1c9286ffed2d13cd78766d31 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:32:29 +0800 Subject: [PATCH] revert "build : remove LLAMA_HTTPLIB option (#19623)" --- common/download.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/common/download.cpp b/common/download.cpp index 5ef60a420..17f930f5a 100644 --- a/common/download.cpp +++ b/common/download.cpp @@ -19,7 +19,9 @@ #include #include +#if defined(LLAMA_USE_HTTPLIB) #include "http.h" +#endif #ifndef __EMSCRIPTEN__ #ifdef __linux__ @@ -140,6 +142,8 @@ std::pair common_download_split_repo_tag(const std::st return {hf_repo, tag}; } +#if defined(LLAMA_USE_HTTPLIB) + class ProgressBar { static inline std::mutex mutex; static inline std::map lines; @@ -764,6 +768,30 @@ std::string common_docker_resolve_model(const std::string & docker) { } } +#else + +common_hf_file_res common_get_hf_file(const std::string &, const std::string &, bool, const common_header_list &) { + throw std::runtime_error("download functionality is not enabled in this build"); +} + +bool common_download_model(const common_params_model &, const std::string &, bool, const common_header_list &) { + throw std::runtime_error("download functionality is not enabled in this build"); +} + +std::string common_docker_resolve_model(const std::string &) { + throw std::runtime_error("download functionality is not enabled in this build"); +} + +int common_download_file_single(const std::string &, + const std::string &, + const std::string &, + bool, + const common_header_list &) { + throw std::runtime_error("download functionality is not enabled in this build"); +} + +#endif // defined(LLAMA_USE_HTTPLIB) + std::vector common_list_cached_models() { std::vector models; const std::string cache_dir = fs_get_cache_directory();