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();