fix: avoid writable mmap for read-only weights (#1698)

This commit is contained in:
leejet
2026-06-23 00:39:31 +08:00
committed by GitHub
parent 41f7acbfb0
commit f440ad9c29
6 changed files with 24 additions and 22 deletions

View File

@@ -480,7 +480,7 @@ bool ModelManager::mmap_params(const std::vector<TensorState*>& states,
return true;
}
auto mmap_store = model_loader_.mmap_tensors(mmap_candidates, {}, true);
auto mmap_store = model_loader_.mmap_tensors(mmap_candidates, {}, writable_mmap_);
if (mmap_store.empty()) {
return true;
}