| 136 | } |
| 137 | |
| 138 | LLAVA_API struct llava_image_embed * llava_image_embed_make_with_filename(struct clip_ctx * ctx_clip, int n_threads, const char * image_path) { |
| 139 | unsigned char* image_bytes; |
| 140 | long image_bytes_length; |
| 141 | auto loaded = load_file_to_bytes(image_path, &image_bytes, &image_bytes_length); |
| 142 | if (!loaded) { |
| 143 | fprintf(stderr, "%s: failed to load %s\n", __func__, image_path); |
| 144 | return NULL; |
| 145 | } |
| 146 | |
| 147 | auto embed = llava_image_embed_make_with_bytes(ctx_clip, n_threads, image_bytes, image_bytes_length); |
| 148 | free(image_bytes); |
| 149 | |
| 150 | return embed; |
| 151 | } |
| 152 | |
| 153 | LLAVA_API void llava_image_embed_free(struct llava_image_embed * embed) { |
| 154 | free(embed->embed); |
no test coverage detected