diff options
author | Georgi Gerganov <ggerganov@gmail.com> | 2024-03-22 21:10:39 +0200 |
---|---|---|
committer | Georgi Gerganov <ggerganov@gmail.com> | 2024-03-22 21:10:39 +0200 |
commit | 56a00f0a2f48a85376f48b5ce77699df781631ae (patch) | |
tree | 88b158c914ebe80cce3ff75f98427af16d1a6d6a | |
parent | 92397d87a45a09b5449d845a64856f177cd7a920 (diff) |
common : default --hf-file to --model (#6234)
-rw-r--r-- | common/common.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/common.cpp b/common/common.cpp index 0cc4859f..de6eb960 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1220,9 +1220,11 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) { throw std::invalid_argument("error: unknown argument: " + arg); } } + if (invalid_param) { throw std::invalid_argument("error: invalid parameter for argument: " + arg); } + if (params.prompt_cache_all && (params.interactive || params.interactive_first || params.instruct)) { @@ -1230,6 +1232,11 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) { throw std::invalid_argument("error: --prompt-cache-all not supported in interactive mode yet\n"); } + // short-hand to avoid specifying --hf-file -> default it to --model + if (!params.hf_repo.empty() && params.hf_file.empty()) { + params.hf_file = params.model; + } + if (params.escape) { process_escapes(params.prompt); process_escapes(params.input_prefix); |