MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / common_params_print_usage

Function common_params_print_usage

subprojects/llama.cpp/common/arg.cpp:643–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643static void common_params_print_usage(common_params_context & ctx_arg) {
644 auto print_options = [](std::vector<common_arg *> & options) {
645 for (common_arg * opt : options) {
646 printf("%s", opt->to_string().c_str());
647 }
648 };
649
650 std::vector<common_arg *> common_options;
651 std::vector<common_arg *> sparam_options;
652 std::vector<common_arg *> specific_options;
653 for (auto & opt : ctx_arg.options) {
654 // in case multiple LLAMA_EXAMPLE_* are set, we prioritize the LLAMA_EXAMPLE_* matching current example
655 if (opt.is_sparam) {
656 sparam_options.push_back(&opt);
657 } else if (opt.in_example(ctx_arg.ex)) {
658 specific_options.push_back(&opt);
659 } else {
660 common_options.push_back(&opt);
661 }
662 }
663 printf("----- common params -----\n\n");
664 print_options(common_options);
665 printf("\n\n----- sampling params -----\n\n");
666 print_options(sparam_options);
667 // TODO: maybe convert enum llama_example to string
668 printf("\n\n----- example-specific params -----\n\n");
669 print_options(specific_options);
670}
671
672static void common_params_print_completion(common_params_context & ctx_arg) {
673 std::vector<common_arg *> common_options;

Callers 1

common_params_parseFunction · 0.85

Calls 3

in_exampleMethod · 0.80
to_stringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected