avoid copying the entire vector

This commit is contained in:
Pierrick HYMBERT 2024-03-21 19:18:39 +01:00
parent 1892ae7eb1
commit 00381b07bb

View file

@ -3243,7 +3243,7 @@ struct llama_model_loader {
const auto & mapping = mappings.at(w.idx); const auto & mapping = mappings.at(w.idx);
ggml_backend_buffer_t buf_mmap = nullptr; ggml_backend_buffer_t buf_mmap = nullptr;
if (bufs_mmap.size() > 1) { if (bufs_mmap.size() > 1) {
buf_mmap = bufs_mmap[w.idx]; buf_mmap = bufs_mmap.at(w.idx);
} else if (!bufs_mmap.empty()) { } else if (!bufs_mmap.empty()) {
buf_mmap = bufs_mmap.front(); buf_mmap = bufs_mmap.front();
} }