Skip to content

Commit

Permalink
move the check for incompatible parameters to gpt_params_parse
Browse files Browse the repository at this point in the history
  • Loading branch information
ejones committed May 10, 2023
1 parent 8c88b17 commit 8826fb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 7 additions & 0 deletions examples/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
gpt_print_usage(argc, argv, default_params);
exit(1);
}
if (params.prompt_cache_all &&
(params.interactive || params.interactive_first ||
params.instruct || params.antiprompt.size())) {
fprintf(stderr, "error: --prompt-cache-all not supported in interactive mode yet\n");
gpt_print_usage(argc, argv, default_params);
exit(1);
}
if (escape_prompt) {
process_escapes(params.prompt);
}
Expand Down
5 changes: 0 additions & 5 deletions examples/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,6 @@ int main(int argc, char ** argv) {
}

if (params.interactive) {
if (params.prompt_cache_all) {
fprintf(stderr, "error: --prompt-cache-all not supported in interactive mode yet\n");
return 1;
}

#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
struct sigaction sigint_action;
sigint_action.sa_handler = sigint_handler;
Expand Down

0 comments on commit 8826fb8

Please sign in to comment.