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

Function parse_layer_prune

tools/quantize/quantize.cpp:467–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467static bool parse_layer_prune(const char * data, std::vector<int> & prune_layers) {
468 if (!data) {
469 printf("\n%s: no layer pruning ids provided\n\n", __func__);
470 return false;
471 }
472
473 const auto block_ids = string_split<std::string>(data, ',');
474 for (const auto & block_id : block_ids) {
475 int id;
476 try {
477 id = std::stoi(block_id);
478 } catch (...) {
479 id = -1;
480 }
481 if (id < 0) {
482 printf("\n%s: invalid layer id '%s'\n\n", __func__, block_id.c_str());
483 return false;
484 }
485 prune_layers.emplace_back(id);
486 }
487
488 sort(prune_layers.begin(), prune_layers.end());
489 prune_layers.erase(std::unique(prune_layers.begin(), prune_layers.end()), prune_layers.end());
490 return true;
491}
492
493int main(int argc, char ** argv) {
494 std::setlocale(LC_NUMERIC, "C");

Callers 1

mainFunction · 0.85

Calls 2

endMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected