MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / common_params_print_usage

Function common_params_print_usage

smallthinker/common/arg.cpp:1006–1033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004}
1005
1006static void common_params_print_usage(common_params_context & ctx_arg) {
1007 auto print_options = [](std::vector<common_arg *> & options) {
1008 for (common_arg * opt : options) {
1009 printf("%s", opt->to_string().c_str());
1010 }
1011 };
1012
1013 std::vector<common_arg *> common_options;
1014 std::vector<common_arg *> sparam_options;
1015 std::vector<common_arg *> specific_options;
1016 for (auto & opt : ctx_arg.options) {
1017 // in case multiple LLAMA_EXAMPLE_* are set, we prioritize the LLAMA_EXAMPLE_* matching current example
1018 if (opt.is_sparam) {
1019 sparam_options.push_back(&opt);
1020 } else if (opt.in_example(ctx_arg.ex)) {
1021 specific_options.push_back(&opt);
1022 } else {
1023 common_options.push_back(&opt);
1024 }
1025 }
1026 printf("----- common params -----\n\n");
1027 print_options(common_options);
1028 printf("\n\n----- sampling params -----\n\n");
1029 print_options(sparam_options);
1030 // TODO: maybe convert enum llama_example to string
1031 printf("\n\n----- example-specific params -----\n\n");
1032 print_options(specific_options);
1033}
1034
1035static void common_params_print_completion(common_params_context & ctx_arg) {
1036 std::vector<common_arg *> common_options;

Callers 1

common_params_parseFunction · 0.85

Calls 5

printfFunction · 0.85
in_exampleMethod · 0.80
c_strMethod · 0.45
to_stringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected