mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-08 18:30:50 +00:00
llama : correct platform-independent loading of BOOL metadata (#21428)
* model-loader : fix GGUF bool array conversion * model-loader : fix remaining GGUF bool pointer uses
This commit is contained in:
parent
af76639f72
commit
58190cc84d
3 changed files with 5 additions and 4 deletions
|
|
@ -374,8 +374,9 @@ namespace GGUFMeta {
|
|||
}
|
||||
} else {
|
||||
if (arr_info.gt == GGUF_TYPE_BOOL) {
|
||||
std::transform((const bool *)arr_info.data, (const bool *)arr_info.data + arr_info.length, result.begin(), [](bool x) {
|
||||
return static_cast<T>(x);
|
||||
const int8_t * values = (const int8_t *) arr_info.data;
|
||||
std::transform(values, values + arr_info.length, result.begin(), [](int8_t x) {
|
||||
return static_cast<T>(x != 0);
|
||||
});
|
||||
} else {
|
||||
std::copy((const T*)arr_info.data, (const T *)arr_info.data + arr_info.length, result.begin());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue