From 2e70b6e3741c155c296b0dd73d374162c0dfec38 Mon Sep 17 00:00:00 2001 From: Amir Date: Mon, 20 May 2024 15:05:32 +0000 Subject: [PATCH] examples: cache hf model when --model not provided --- common/common.cpp | 11 ----------- common/common.h | 6 ------ 2 files changed, 17 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 23ec4de64..1049d3c0c 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -2081,17 +2081,6 @@ static bool llama_download_file(const std::string & url, const std::string & pat } } - // Create parent directories if not exist - const std::vector path_parts = string_split(path_temporary, DIRECTORY_SEPARATOR); - std::string parent_dir = ""; - struct stat st; - for (unsigned i = 0; i < path_parts.size() - 1; i++) { - parent_dir += path_parts[i] + DIRECTORY_SEPARATOR; - if (stat(parent_dir.c_str(), &st) != 0) { - mkdir(parent_dir.c_str(), S_IRWXU); - } - } - // Set the output file std::unique_ptr outfile(fopen(path_temporary.c_str(), "wb"), fclose); if (!outfile) { diff --git a/common/common.h b/common/common.h index f150c1602..a8e5e50e6 100644 --- a/common/common.h +++ b/common/common.h @@ -32,12 +32,6 @@ } while(0) #define DEFAULT_MODEL_PATH "models/7B/ggml-model-f16.gguf" -#define DEFAULT_LLAMA_CACHE ".cache/" - -#ifdef _WIN32 -#include -#define mkdir(path, mode) _mkdir(path) // On Windows, _mkdir does not take mode -#endif // build info extern int LLAMA_BUILD_NUMBER;