| 16 | #include "tokenizer.h" |
| 17 | |
| 18 | void error_usage() { |
| 19 | fprintf(stderr, "Usage: main <checkpoint_dir> [options]\n"); |
| 20 | fprintf(stderr, "Example: main model_weights_dir/ -i \"Q: What is the meaning of life?\"\n"); |
| 21 | fprintf(stderr, "Options:\n"); |
| 22 | fprintf(stderr, " -h Display this help message\n"); |
| 23 | fprintf(stderr, " -L Locks model weights to RAM, disabling swap. Requires sudo.\n"); |
| 24 | fprintf(stderr, " -m [completion,passkey,perplexity,interactive] which mode to run in (default - completion)\n"); |
| 25 | fprintf(stderr, " -T <int> sliding window context length (0 - max)\n"); |
| 26 | fprintf(stderr, "\n"); |
| 27 | fprintf(stderr, "Perplexity mode options:\n"); |
| 28 | fprintf(stderr, " Choose one:\n"); |
| 29 | fprintf(stderr, " -i <string> input prompt\n"); |
| 30 | fprintf(stderr, " -f <filepath> input file with prompt\n"); |
| 31 | fprintf(stderr, " -w use wikitext as input\n"); |
| 32 | fprintf(stderr, "Completion mode options:\n"); |
| 33 | fprintf(stderr, " -n <int> number of steps to run for in completion mode, default 256. 0 = max_seq_len, -1 = infinite\n"); |
| 34 | fprintf(stderr, " Choose one:\n"); |
| 35 | fprintf(stderr, " -i <string> input prompt\n"); |
| 36 | fprintf(stderr, " -t <float> temperature (default - 1.0)\n"); |
| 37 | fprintf(stderr, " -p <float> p for top-p sampling (default - 0.95)\n"); |
| 38 | fprintf(stderr, " -f <filepath> input file with prompt\n"); |
| 39 | fprintf(stderr, "Passkey mode options:\n"); |
| 40 | fprintf(stderr, " -n <int> number of junk lines to insert (default - 250)\n"); |
| 41 | fprintf(stderr, " -l <int> passkey position (-1 - random)\n"); |
| 42 | exit(1); |
| 43 | } |
| 44 | |
| 45 | void help_usage_interactive() { |
| 46 | fprintf(stderr, "Usage: <mode> [options]\n"); |