Skip to content

Commit 56a00f0

Browse files
committed
common : default --hf-file to --model (#6234)
1 parent 92397d8 commit 56a00f0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/common.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1220,16 +1220,23 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) {
12201220
throw std::invalid_argument("error: unknown argument: " + arg);
12211221
}
12221222
}
1223+
12231224
if (invalid_param) {
12241225
throw std::invalid_argument("error: invalid parameter for argument: " + arg);
12251226
}
1227+
12261228
if (params.prompt_cache_all &&
12271229
(params.interactive || params.interactive_first ||
12281230
params.instruct)) {
12291231

12301232
throw std::invalid_argument("error: --prompt-cache-all not supported in interactive mode yet\n");
12311233
}
12321234

1235+
// short-hand to avoid specifying --hf-file -> default it to --model
1236+
if (!params.hf_repo.empty() && params.hf_file.empty()) {
1237+
params.hf_file = params.model;
1238+
}
1239+
12331240
if (params.escape) {
12341241
process_escapes(params.prompt);
12351242
process_escapes(params.input_prefix);

0 commit comments

Comments
 (0)