mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-03-07 04:20:03 +00:00
gguf-split: fix the split output files naming (#1336)
* Fix gguf-split.cpp splits output naming With this fix, the initial extension of the source .gguf file is not included in the naming of the output file before the numeration of the splits. ex: No more model.gguf-00001-of-00200.gguf Instead, model-00001-of-00200.gguf * increase ggml_max_context to 2048 * Revert GGML_MAX_CONTEXTS to 64
This commit is contained in:
@@ -318,10 +318,16 @@ struct split_strategy {
|
||||
void write() {
|
||||
int i_split = 0;
|
||||
int n_split = ctx_outs.size();
|
||||
std::string output_prefix = params.output;
|
||||
const std::string suffix = ".gguf";
|
||||
if (output_prefix.size() >= suffix.size() &&
|
||||
output_prefix.compare(output_prefix.size() - suffix.size(), suffix.size(), suffix) == 0) {
|
||||
output_prefix.resize(output_prefix.size() - suffix.size());
|
||||
}
|
||||
for (auto & ctx_out : ctx_outs) {
|
||||
// construct file path
|
||||
char split_path[PATH_MAX] = {0};
|
||||
llama_split_path(split_path, sizeof(split_path), params.output.c_str(), i_split, n_split);
|
||||
llama_split_path(split_path, sizeof(split_path), output_prefix.c_str(), i_split, n_split);
|
||||
|
||||
ensure_output_directory(split_path);
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
// Maximum number of model contexts (e.g., for model shards).
|
||||
// Increase this value using -DGGML_MAX_CONTEXTS=<value> in CMake
|
||||
// if you need to load more than 64 model shards.
|
||||
#define GGML_MAX_CONTEXTS 64
|
||||
#define GGML_MAX_CONTEXTS 64
|
||||
#endif
|
||||
#define GGML_MAX_SRC 10
|
||||
#ifndef GGML_MAX_NAME
|
||||
|
||||
Reference in New Issue
Block a user