| 734 | } |
| 735 | |
| 736 | void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) { |
| 737 | const llama_sampling_params & sparams = params.sparams; |
| 738 | |
| 739 | printf("\n"); |
| 740 | printf("usage: %s [options]\n", argv[0]); |
| 741 | printf("\n"); |
| 742 | printf("options:\n"); |
| 743 | printf(" -h, --help show this help message and exit\n"); |
| 744 | printf(" -i, --interactive run in interactive mode\n"); |
| 745 | printf(" --interactive-first run in interactive mode and wait for input right away\n"); |
| 746 | printf(" -ins, --instruct run in instruction mode (use with Alpaca models)\n"); |
| 747 | printf(" --multiline-input allows you to write or paste multiple lines without ending each in '\\'\n"); |
| 748 | printf(" -r PROMPT, --reverse-prompt PROMPT\n"); |
| 749 | printf(" halt generation at PROMPT, return control in interactive mode\n"); |
| 750 | printf(" (can be specified more than once for multiple prompts).\n"); |
| 751 | printf(" --color colorise output to distinguish prompt and user input from generations\n"); |
| 752 | printf(" -s SEED, --seed SEED RNG seed (default: -1, use random seed for < 0)\n"); |
| 753 | printf(" -t N, --threads N number of threads to use during generation (default: %d)\n", params.n_threads); |
| 754 | printf(" -tb N, --threads-batch N\n"); |
| 755 | printf(" number of threads to use during batch and prompt processing (default: same as --threads)\n"); |
| 756 | printf(" -p PROMPT, --prompt PROMPT\n"); |
| 757 | printf(" prompt to start generation with (default: empty)\n"); |
| 758 | printf(" -e, --escape process prompt escapes sequences (\\n, \\r, \\t, \\', \\\", \\\\)\n"); |
| 759 | printf(" --prompt-cache FNAME file to cache prompt state for faster startup (default: none)\n"); |
| 760 | printf(" --prompt-cache-all if specified, saves user input and generations to cache as well.\n"); |
| 761 | printf(" not supported with --interactive or other interactive options\n"); |
| 762 | printf(" --prompt-cache-ro if specified, uses the prompt cache but does not update it.\n"); |
| 763 | printf(" --random-prompt start with a randomized prompt.\n"); |
| 764 | printf(" --in-prefix-bos prefix BOS to user inputs, preceding the `--in-prefix` string\n"); |
| 765 | printf(" --in-prefix STRING string to prefix user inputs with (default: empty)\n"); |
| 766 | printf(" --in-suffix STRING string to suffix after user inputs with (default: empty)\n"); |
| 767 | printf(" -f FNAME, --file FNAME\n"); |
| 768 | printf(" prompt file to start generation.\n"); |
| 769 | printf(" -n N, --n-predict N number of tokens to predict (default: %d, -1 = infinity, -2 = until context filled)\n", params.n_predict); |
| 770 | printf(" -c N, --ctx-size N size of the prompt context (default: %d, 0 = loaded from model)\n", params.n_ctx); |
| 771 | printf(" -b N, --batch-size N batch size for prompt processing (default: %d)\n", params.n_batch); |
| 772 | printf(" --top-k N top-k sampling (default: %d, 0 = disabled)\n", sparams.top_k); |
| 773 | printf(" --top-p N top-p sampling (default: %.1f, 1.0 = disabled)\n", (double)sparams.top_p); |
| 774 | printf(" --min-p N min-p sampling (default: %.1f, 0.0 = disabled)\n", (double)sparams.min_p); |
| 775 | printf(" --tfs N tail free sampling, parameter z (default: %.1f, 1.0 = disabled)\n", (double)sparams.tfs_z); |
| 776 | printf(" --typical N locally typical sampling, parameter p (default: %.1f, 1.0 = disabled)\n", (double)sparams.typical_p); |
| 777 | printf(" --repeat-last-n N last n tokens to consider for penalize (default: %d, 0 = disabled, -1 = ctx_size)\n", sparams.penalty_last_n); |
| 778 | printf(" --repeat-penalty N penalize repeat sequence of tokens (default: %.1f, 1.0 = disabled)\n", (double)sparams.penalty_repeat); |
| 779 | printf(" --presence-penalty N repeat alpha presence penalty (default: %.1f, 0.0 = disabled)\n", (double)sparams.penalty_present); |
| 780 | printf(" --frequency-penalty N repeat alpha frequency penalty (default: %.1f, 0.0 = disabled)\n", (double)sparams.penalty_freq); |
| 781 | printf(" --mirostat N use Mirostat sampling.\n"); |
| 782 | printf(" Top K, Nucleus, Tail Free and Locally Typical samplers are ignored if used.\n"); |
| 783 | printf(" (default: %d, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0)\n", sparams.mirostat); |
| 784 | printf(" --mirostat-lr N Mirostat learning rate, parameter eta (default: %.1f)\n", (double)sparams.mirostat_eta); |
| 785 | printf(" --mirostat-ent N Mirostat target entropy, parameter tau (default: %.1f)\n", (double)sparams.mirostat_tau); |
| 786 | printf(" -l TOKEN_ID(+/-)BIAS, --logit-bias TOKEN_ID(+/-)BIAS\n"); |
| 787 | printf(" modifies the likelihood of token appearing in the completion,\n"); |
| 788 | printf(" i.e. `--logit-bias 15043+1` to increase likelihood of token ' Hello',\n"); |
| 789 | printf(" or `--logit-bias 15043-1` to decrease likelihood of token ' Hello'\n"); |
| 790 | printf(" --grammar GRAMMAR BNF-like grammar to constrain generations (see samples in grammars/ dir)\n"); |
| 791 | printf(" --grammar-file FNAME file to read grammar from\n"); |
| 792 | printf(" --cfg-negative-prompt PROMPT\n"); |
| 793 | printf(" negative prompt to use for guidance. (default: empty)\n"); |
no test coverage detected