summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDAN™ <dranger003@gmail.com>2024-03-21 21:32:42 -0400
committerGitHub <noreply@github.com>2024-03-22 02:32:42 +0100
commitfa046eafbc70bf97dcf39843af0323f19a8c9ac3 (patch)
tree07fcce13960276d2fe91c79489e5f5d68d76f280 /common
parentbe07a03217376c53b1d95e5f658adbbbb2831555 (diff)
Fix params underscore convert to dash. (#6203)
* Fix params underscore convert to dash. * Update common/common.cpp --------- Co-authored-by: slaren <slarengh@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/common.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/common.cpp b/common/common.cpp
index 192182d0..11bf554d 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -154,8 +154,7 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
return result;
}
-static bool gpt_params_find_arg(int argc, char ** argv, gpt_params & params, int & i, bool & invalid_param) {
- std::string arg = argv[i];
+static bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_params & params, int & i, bool & invalid_param) {
llama_sampling_params& sparams = params.sparams;
if (arg == "-s" || arg == "--seed") {
@@ -1201,7 +1200,7 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) {
std::replace(arg.begin(), arg.end(), '_', '-');
}
- if (!gpt_params_find_arg(argc, argv, params, i, invalid_param)) {
+ if (!gpt_params_find_arg(argc, argv, arg, params, i, invalid_param)) {
throw std::invalid_argument("error: unknown argument: " + arg);
}
}