@@ -146,30 +146,8 @@ def llava_eval_image_embed(ctx_llama: llama_cpp.llama_context_p, embed: "_Pointe
146
146
################################################
147
147
148
148
149
- # struct clip_vision_hparams {
150
- # int32_t image_size;
151
- # int32_t patch_size;
152
- # int32_t hidden_size;
153
- # int32_t n_intermediate;
154
- # int32_t projection_dim;
155
- # int32_t n_head;
156
- # int32_t n_layer;
157
- # float eps;
158
- # };
159
- class clip_vision_hparams
10000
(Structure ):
160
- _fields_ = [
161
- ("image_size" , c_int32 ),
162
- ("patch_size" , c_int32 ),
163
- ("hidden_size" , c_int32 ),
164
- ("n_intermediate" , c_int32 ),
165
- ("projection_dim" , c_int32 ),
166
- ("n_head" , c_int32 ),
167
- ("n_layer" , c_int32 ),
168
- ("eps" , c_float ),
169
- ]
170
-
171
149
# /** load mmproj model */
172
- # CLIP_API struct clip_ctx * clip_model_load(const char * fname, const int verbosity);
150
+ # CLIP_API struct clip_ctx * clip_model_load (const char * fname, int verbosity);
173
151
def clip_model_load (fname : bytes , verbosity : Union [c_int , int ]) -> clip_ctx_p :
174
152
return _libllava .clip_model_load (fname , verbosity )
175
153
@@ -183,50 +161,3 @@ def clip_free(ctx: clip_ctx_p):
183
161
184
162
_libllava .clip_free .argtypes = [clip_ctx_p ]
185
163
_libllava .clip_free .restype = None
186
-
187
- # size_t clip_embd_nbytes(const struct clip_ctx * ctx);
188
- # int clip_n_patches(const struct clip_ctx * ctx);
189
- # int clip_n_mmproj_embd(const struct clip_ctx * ctx);
190
-
191
- # // RGB uint8 image
192
- # struct clip_image_u8 {
193
- # int nx;
194
- # int ny;
195
- # uint8_t * data = NULL;
196
- # size_t size;
197
- # };
198
-
199
- # // RGB float32 image (NHWC)
200
- # // Memory layout: RGBRGBRGB...
201
- # struct clip_image_f32 {
202
- # int nx;
203
- # int ny;
204
- # float * data = NULL;
205
- # size_t size;
206
- # };
207
-
208
- # struct clip_image_u8_batch {
209
- # struct clip_image_u8 * data;
210
- # size_t size;
211
- # };
212
-
213
- # struct clip_image_f32_batch {
214
- # struct clip_image_f32 * data;
215
- # size_t size;
216
- # };
217
-
218
- # struct clip_image_u8 * make_clip_image_u8();
219
- # struct clip_image_f32 * make_clip_image_f32();
220
- # CLIP_API void clip_image_u8_free(clip_image_u8 * img);
221
- # CLIP_API void clip_image_f32_free(clip_image_f32 * img);
222
- # CLIP_API bool clip_image_load_from_file(const char * fname, struct clip_image_u8 * img);
223
- # /** interpret bytes as an image file with length bytes_length, and use the result to populate img */
224
- # CLIP_API bool clip_image_load_from_bytes(const unsigned char * bytes, size_t bytes_length, struct clip_image_u8 * img);
225
-
226
- # bool clip_image_preprocess(const struct clip_ctx * ctx, const struct clip_image_u8 * img, struct clip_image_f32 * res, const bool pad2square);
227
- # bool clip_image_encode(const struct clip_ctx * ctx, const int n_threads, struct clip_image_f32 * img, float * vec);
228
-
229
- # bool clip_image_batch_encode(const struct clip_ctx * ctx, const int n_threads, const struct clip_image_f32_batch * imgs,
230
- # float * vec);
231
-
232
- # bool clip_model_quantize(const char * fname_inp, const char * fname_out, const int itype);
0 commit comments