Skip to content

Commit ce02093

Browse files
authored
app : show version (#23426)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 6a257d4 commit ce02093

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/llama.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "build-info.h"
2+
13
#include <cstdio>
24
#include <string>
35
#include <vector>
@@ -9,6 +11,7 @@ int llama_cli(int argc, char ** argv);
911
int llama_completion(int argc, char ** argv);
1012
int llama_bench(int argc, char ** argv);
1113
static int help(int argc, char ** argv);
14+
static int version(int argc, char ** argv);
1215

1316
struct command {
1417
const char * name;
@@ -23,9 +26,15 @@ static const command cmds[] = {
2326
{"cli", "Command-line interactive interface", {"client"}, false, llama_cli },
2427
{"completion", "Text completion", {"complete"}, true, llama_completion },
2528
{"bench", "Benchmarking tool", {}, true, llama_bench },
29+
{"version", "Show version", {}, true, version },
2630
{"help", "Show available commands", {}, true, help },
2731
};
2832

33+
static int version(int argc, char ** argv) {
34+
printf("%s\n", llama_build_info());
35+
return 0;
36+
}
37+
2938
static int help(int argc, char ** argv) {
3039
const bool show_all = argc >= 2 && std::string(argv[1]) == "all";
3140

0 commit comments

Comments
 (0)