clip : refactor clip_init, add tests (#12757)

* refactor clip_init

* fix loading file

* fix style

* test ok

* better test with report

* add missing headers

* clarify

* add KEY_MM_PATCH_MERGE_TYPE

* remove bool has_* pattern

* Apply suggestions from code review

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* Update examples/llava/clip.cpp

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* use ggml_soft_max_ext

* refactor logging system

* add minicpm-v-o 2.6 for testing

* use nullptr everywhere

* fix Yi-VL model

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
Xuan-Son Nguyen 2025-04-05 17:17:40 +02:00 committed by GitHub
parent c6ff5d2a8d
commit 0364178ca2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 916 additions and 887 deletions

View file

@ -1,6 +1,7 @@
#ifndef CLIP_H
#define CLIP_H
#include "ggml.h"
#include <stddef.h>
#include <stdint.h>
@ -41,7 +42,7 @@ struct clip_image_f32_batch {
struct clip_context_params {
bool use_gpu;
int verbosity;
ggml_log_level verbosity;
};
// deprecated, use clip_init