| 1121 | } |
| 1122 | |
| 1123 | int32_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 | |
| 1152 | const char * llama_print_system_info(void) { |
| 1153 | static std::string s; |
no test coverage detected