summaryrefslogtreecommitdiff
path: root/common/common.h
diff options
context:
space:
mode:
authorOlivier Chafik <ochafik@users.noreply.github.com>2024-04-30 00:52:50 +0100
committerGitHub <noreply@github.com>2024-04-30 00:52:50 +0100
commit8843a98c2ba97a25e93319a104f9ddfaf83ce4c4 (patch)
tree82d73687b9dd42033a388d83c3b491925a0444b9 /common/common.h
parentb8c1476e44cc1f3a1811613f65251cf779067636 (diff)
Improve usability of --model-url & related flags (#6930)
* args: default --model to models/ + filename from --model-url or --hf-file (or else legacy models/7B/ggml-model-f16.gguf) * args: main & server now call gpt_params_handle_model_default * args: define DEFAULT_MODEL_PATH + update cli docs * curl: check url of previous download (.json metadata w/ url, etag & lastModified) * args: fix update to quantize-stats.cpp * curl: support legacy .etag / .lastModified companion files * curl: rm legacy .etag file support * curl: reuse regex across headers callback calls * curl: unique_ptr to manage lifecycle of curl & outfile * curl: nit: no need for multiline regex flag * curl: update failed test (model file collision) + gitignore *.gguf.json
Diffstat (limited to 'common/common.h')
-rw-r--r--common/common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/common.h b/common/common.h
index 3233d90e..8afdf2bd 100644
--- a/common/common.h
+++ b/common/common.h
@@ -31,6 +31,8 @@
fprintf(stderr, "%s: built with %s for %s\n", __func__, LLAMA_COMPILER, LLAMA_BUILD_TARGET); \
} while(0)
+#define DEFAULT_MODEL_PATH "models/7B/ggml-model-f16.gguf"
+
// build info
extern int LLAMA_BUILD_NUMBER;
extern char const *LLAMA_COMMIT;
@@ -92,7 +94,7 @@ struct gpt_params {
// // sampling parameters
struct llama_sampling_params sparams;
- std::string model = "models/7B/ggml-model-f16.gguf"; // model path
+ std::string model = ""; // model path
std::string model_draft = ""; // draft model for speculative decoding
std::string model_alias = "unknown"; // model alias
std::string model_url = ""; // model url to download
@@ -171,6 +173,8 @@ struct gpt_params {
std::vector<std::string> image; // path to image file(s)
};
+void gpt_params_handle_model_default(gpt_params & params);
+
bool parse_kv_override(const char * data, std::vector<llama_model_kv_override> & overrides);
bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params);