Update clip.cpp

bugfix for new conversions
This commit is contained in:
John 2024-01-24 01:43:00 +01:00 committed by GitHub
parent 0dbd295e39
commit fccab82f5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -846,10 +846,11 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) {
new_clip->proj_type = clip_projector_type_from_string(proj_type);
}
else {
new_clip->proj_type = PROJECTOR_TYPE_MLP;
}
if (new_clip->proj_type == PROJECTOR_TYPE_MLP) {
if (gguf_find_tensor(ctx, format(TN_LLAVA_PROJ, 3, "weight").c_str()) != -1) {
new_clip->proj_type = PROJECTOR_TYPE_MLP_NORM;
} else {
new_clip->proj_type = PROJECTOR_TYPE_MLP;
}
}
}