MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / main

Function main

tools/tokenize/tokenize.cpp:187–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187int main(int raw_argc, char ** raw_argv) {
188 std::setlocale(LC_NUMERIC, "C");
189
190 const std::vector<std::string> argv = ingest_args(raw_argc, raw_argv);
191 const int argc = argv.size();
192
193 if (argc <= 1) {
194 print_usage_information(argv[0].c_str());
195 return 1;
196 }
197
198 //////
199 // Read out all the command line arguments.
200 //////
201
202 // variables where to put any arguments we see.
203 bool printing_ids = false;
204 bool no_bos = false;
205 bool no_escape = false;
206 bool no_parse_special = false;
207 bool disable_logging = false;
208 bool show_token_count = false;
209 const char * model_path = NULL;
210 const char * prompt_path = NULL;
211 const char * prompt_arg = NULL;
212
213 // track which arguments were explicitly given
214 // used for sanity checking down the line
215 bool model_path_set = false;
216 bool prompt_path_set = false;
217 bool prompt_set = false;
218 bool stdin_set = false;
219
220 int iarg = 1;
221 for (; iarg < argc; ++iarg) {
222 std::string arg{argv[iarg]};
223 if (arg == "-h" || arg == "--help") {
224 print_usage_information(argv[0].c_str());
225 return 0;
226 }
227 else if (arg == "--ids") {
228 printing_ids = true;
229 }
230 else if (arg == "-m" || arg == "--model") {
231 if (model_path_set) {
232 fprintf(stderr, "Error: -m or --model specified multiple times.\n");
233 return 1;
234 }
235 model_path = argv[++iarg].c_str();
236 model_path_set = true;
237 }
238 else if (arg == "--no-bos") {
239 no_bos = true;
240 }
241 else if (arg == "--no-escape") {
242 no_escape = true;
243 }
244 else if (arg == "--no-parse-special") {

Callers

nothing calls this directly

Calls 15

ingest_argsFunction · 0.85
print_usage_informationFunction · 0.85
llama_log_setFunction · 0.85
llama_backend_initFunction · 0.85
llama_model_get_vocabFunction · 0.85
llama_init_from_modelFunction · 0.85
llama_vocab_get_add_bosFunction · 0.85
string_process_escapesFunction · 0.85
common_tokenizeFunction · 0.85

Tested by

no test coverage detected