| 16 | #endif |
| 17 | |
| 18 | static void print_usage_information(const char * argv0) { |
| 19 | printf("usage: %s [options]\n\n", argv0); |
| 20 | printf("The tokenize program tokenizes a prompt using a given model,\n"); |
| 21 | printf("and prints the resulting tokens to standard output.\n\n"); |
| 22 | printf("It needs a model file, a prompt, and optionally other flags\n"); |
| 23 | printf("to control the behavior of the tokenizer.\n\n"); |
| 24 | printf(" The possible options are:\n"); |
| 25 | printf("\n"); |
| 26 | printf(" -h, --help print this help and exit\n"); |
| 27 | printf(" -m MODEL_PATH, --model MODEL_PATH path to model.\n"); |
| 28 | printf(" --ids if given, only print numerical token IDs, and not token strings.\n"); |
| 29 | printf(" The output format looks like [1, 2, 3], i.e. parseable by Python.\n"); |
| 30 | printf(" -f PROMPT_FNAME, --file PROMPT_FNAME read prompt from a file.\n"); |
| 31 | printf(" -p PROMPT, --prompt PROMPT read prompt from the argument.\n"); |
| 32 | printf(" --stdin read prompt from standard input.\n"); |
| 33 | printf(" --no-bos do not ever add a BOS token to the prompt, even if normally the model uses a BOS token.\n"); |
| 34 | printf(" --no-escape do not escape input (such as \\n, \\t, etc.).\n"); |
| 35 | printf(" --no-parse-special do not parse control tokens.\n"); |
| 36 | printf(" --log-disable disable logs. Makes stderr quiet when loading the model.\n"); |
| 37 | printf(" --show-count print the total number of tokens.\n"); |
| 38 | } |
| 39 | |
| 40 | static void llama_log_callback_null(ggml_log_level level, const char * text, void * user_data) { |
| 41 | (void) level; |