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

Function llama_split_prefix

subprojects/llama.cpp/src/llama.cpp:1123–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1121}
1122
1123int32_t llama_split_prefix(
1124 char * split_prefix,
1125 size_t maxlen,
1126 const char * split_path,
1127 int32_t split_no,
1128 int32_t split_count) {
1129
1130 const std::string str_split_path(split_path);
1131
1132 char postfix[32];
1133 snprintf(postfix, sizeof(postfix), "-%05d-of-%05d.gguf", split_no + 1, split_count);
1134
1135 const std::string str_postfix(postfix);
1136 if (str_split_path.size() <= str_postfix.size()) {
1137 return 0;
1138 }
1139
1140 const size_t size_prefix = str_split_path.size() - str_postfix.size();
1141
1142 if (str_split_path.compare(size_prefix, std::string::npos, str_postfix) == 0) {
1143 const size_t copy_len = std::min(size_prefix + 1, maxlen);
1144 snprintf(split_prefix, copy_len, "%s", split_path);
1145
1146 return (int32_t) size_prefix;
1147 }
1148
1149 return 0;
1150}
1151
1152const char * llama_print_system_info(void) {
1153 static std::string s;

Callers 3

gguf_mergeFunction · 0.85
llama_get_list_splitsFunction · 0.85
common_download_modelFunction · 0.85

Calls 3

minFunction · 0.85
sizeMethod · 0.65
compareMethod · 0.45

Tested by

no test coverage detected