Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

image_mean and image_std are not read properly from gguf file #104

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /