Skip to content

Commit

Permalink
use CHECK_ARG for arguemnt parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
iamlemec committed Jun 24, 2024
1 parent ff6d3c1 commit 632a718
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,7 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
return true;
}
if (arg == "--attention") {
if (++i >= argc) {
invalid_param = true;
return true;
}
CHECK_ARG
std::string value(argv[i]);
/**/ if (value == "causal") { params.attention_type = LLAMA_ATTENTION_TYPE_CAUSAL; }
else if (value == "non-causal") { params.attention_type = LLAMA_ATTENTION_TYPE_NON_CAUSAL; }
Expand Down

0 comments on commit 632a718

Please sign in to comment.