llama : add llama_model_load_from_splits (#11255)

* llama : add `llama_model_load_from_splits`

* update
This commit is contained in:
Xuan Son Nguyen 2025-01-16 13:54:08 +01:00 committed by GitHub
parent c67cc9837d
commit 681149ced2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 116 additions and 24 deletions

View file

@ -90,7 +90,12 @@ struct llama_model_loader {
size_t size_data = 0;
std::vector<std::pair<size_t, size_t>> mmaps_used;
llama_model_loader(const std::string & fname, bool use_mmap, bool check_tensors, const struct llama_model_kv_override * param_overrides_p);
llama_model_loader(
const std::string & fname,
std::vector<std::string> & splits, // optional, only need if the split does not follow naming scheme
bool use_mmap,
bool check_tensors,
const struct llama_model_kv_override * param_overrides_p);
template<typename T>
typename std::enable_if<std::is_integral<T>::value, bool>::type