Skip to content

Commit ffd9438

Browse files
dranger003slaren
authored andcommitted
Fix params underscore convert to dash. (ggml-org#6203)
* Fix params underscore convert to dash. * Update common/common.cpp --------- Co-authored-by: slaren <[email protected]>
1 parent e50fea8 commit ffd9438

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

common/common.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
154154
return result;
155155
}
156156

157-
static bool gpt_params_find_arg(int argc, char ** argv, gpt_params & params, int & i, bool & invalid_param) {
158-
std::string arg = argv[i];
157+
static bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_params & params, int & i, bool & invalid_param) {
159158
llama_sampling_params& sparams = params.sparams;
160159

161160
if (arg == "-s" || arg == "--seed") {
@@ -1201,7 +1200,7 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) {
12011200
std::replace(arg.begin(), arg.end(), '_', '-');
12021201
}
12031202

1204-
if (!gpt_params_find_arg(argc, argv, params, i, invalid_param)) {
1203+
if (!gpt_params_find_arg(argc, argv, arg, params, i, invalid_param)) {
12051204
throw std::invalid_argument("error: unknown argument: " + arg);
12061205
}
12071206
}

0 commit comments

Comments
 (0)