summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSiwen Yu <yusiwen@gmail.com>2023-12-13 20:50:14 +0800
committerGitHub <noreply@github.com>2023-12-13 14:50:14 +0200
commit9fb13f95840c722ad419f390dc8a9c86080a3700 (patch)
tree2045cd7c4a71512aad0f33a00f99db6d252fdc0d /common
parent113f9942fc73a262c85e9dcf7c2ea7336250bba0 (diff)
common : add `--version` option to show build info in CLI (#4433)
Diffstat (limited to 'common')
-rw-r--r--common/common.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/common.cpp b/common/common.cpp
index 4a61ae59..93d5483e 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -656,6 +656,10 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) {
} else if (arg == "-h" || arg == "--help") {
return false;
+ } else if (arg == "--version") {
+ fprintf(stderr, "version: %d (%s)\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT);
+ fprintf(stderr, "built with %s for %s\n", LLAMA_COMPILER, LLAMA_BUILD_TARGET);
+ exit(0);
} else if (arg == "--random-prompt") {
params.random_prompt = true;
} else if (arg == "--in-prefix-bos") {
@@ -794,6 +798,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
printf("\n");
printf("options:\n");
printf(" -h, --help show this help message and exit\n");
+ printf(" --version show version and build info\n");
printf(" -i, --interactive run in interactive mode\n");
printf(" --interactive-first run in interactive mode and wait for input right away\n");
printf(" -ins, --instruct run in instruction mode (use with Alpaca models)\n");