@@ -142,28 +142,6 @@ def llava_eval_image_embed(
142
142
################################################
143
143
144
144
145
- # struct clip_image_u8_batch {
146
- # struct clip_image_u8 * data;
147
- # size_t size;
148
- # };
149
- class clip_image_u8_batch (Structure ):
150
- _fields_ = [
151
- ("data" , c_void_p ),
152
- ("size" , c_size_t ),
153
- ]
154
-
155
-
156
- # struct clip_image_f32_batch {
157
- # struct clip_image_f32 * data;
158
- # size_t size;
159
- # };
160
- class clip_image_f32_batch (Structure ):
161
- _fields_ = [
162
- ("data" , c_void_p ),
163
- ("size" , c_size_t ),
164
- ]
165
-
166
-
167
145
# /** load mmproj model */
168
146
# CLIP_API struct clip_ctx * clip_model_load (const char * fname, int verbosity);
169
147
@ctypes_function ("clip_model_load" , [c_char_p , c_int ], clip_ctx_p_ctypes )
@@ -192,21 +170,15 @@ def clip_image_u8_free(img: c_void_p, /):
192
170
...
193
171
194
172
195
- # CLIP_API void clip_image_f32_free(struct clip_image_f32 * img);
196
- @ctypes_function ("clip_image_f32_free" , [c_void_p ], None )
197
- def clip_image_f32_free (img : c_void_p , / ):
198
- ...
199
-
200
-
201
- # CLIP_API void clip_image_u8_batch_free (struct clip_image_u8_batch * batch);
202
- @ctypes_function ("clip_image_u8_batch_free" , [POINTER (clip_image_u8_batch )], None )
203
- def clip_image_u8_batch_free (batch : "_Pointer[clip_image_u8_batch]" , / ):
173
+ # CLIP_API struct clip_image_f32_batch * clip_image_f32_batch_init();
174
+ @ctypes_function ("clip_image_f32_batch_init" , [], c_void_p )
175
+ def clip_image_f32_batch_init () -> Optional [c_void_p ]:
204
176
...
205
177
206
178
207
179
# CLIP_API void clip_image_f32_batch_free(struct clip_image_f32_batch * batch);
208
- @ctypes_function ("clip_image_f32_batch_free" , [POINTER ( clip_image_f32_batch ) ], None )
209
- def clip_image_f32_batch_free (batch : "_Pointer[clip_image_f32_batch]" , / ):
180
+ @ctypes_function ("clip_image_f32_batch_free" , [c_void_p ], None )
181
+ def clip_image_f32_batch_free (batch : c_void_p , / ):
210
182
...
211
183
212
184
@@ -217,14 +189,14 @@ def clip_image_f32_batch_free(batch: "_Pointer[clip_image_f32_batch]", /):
217
189
[
218
190
clip_ctx_p_ctypes ,
219
191
c_void_p ,
220
- POINTER ( clip_image_f32_batch ) ,
192
+ c_void_p ,
221
193
],
222
194
c_bool ,
223
195
)
224
196
def clip_image_preprocess (
225
197
ctx : clip_ctx_p ,
226
198
img : c_void_p ,
227
- res_imgs : "_Pointer[clip_image_f32_batch]" ,
199
+ res_imgs : c_void_p ,
228
200
/ ,
229
201
) -> bool :
230
202
...
@@ -236,15 +208,15 @@ def clip_image_preprocess(
236
208
[
237
209
clip_ctx_p_ctypes ,
238
210
c_int ,
239
- POINTER ( clip_image_f32_batch ) ,
211
+ c_void_p ,
240
212
POINTER (c_float ),
241
213
],
242
214
c_bool ,
243
215
)
244
216
def clip_image_batch_encode (
245
217
ctx : clip_ctx_p ,
246
218
n_threads : c_int ,
247
- imgs : "_Pointer[clip_image_f32_batch]" ,
219
+ imgs : c_void_p ,
248
220
vec : c_void_p ,
249
221
/ ,
250
222
) -> bool :
0 commit comments