-
-
Notifications
You must be signed in to change notification settings - Fork 47
Open
@herf
Description
Around L539 in clip.cpp:
for (int i = 0; i < 3; ++i) {
new_clip->image_mean[i] = *((float *)gguf_get_arr_data(ctx, idx_mean));
new_clip->image_std[i] = *((float *)gguf_get_arr_data(ctx, idx_std));
}
This code will read the mean[0] and std[0] into all three members (rather than the actual vector[3]).
It should say:
for (int i = 0; i < 3; ++i) {
new_clip->image_mean[i] = ((float *)gguf_get_arr_data(ctx, idx_mean))[i];
new_clip->image_std[i] = ((float *)gguf_get_arr_data(ctx, idx_std))[i];
}
Probably should also validate the array size before doing this - is gguf_get_arr_n() "length"?
Metadata
Metadata
Assignees
Labels
No labels