MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / llava_image_embed_make_with_filename

Function llava_image_embed_make_with_filename

examples/llava/llava.cpp:138–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138LLAVA_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
153LLAVA_API void llava_image_embed_free(struct llava_image_embed * embed) {
154 free(embed->embed);

Callers 1

load_imageFunction · 0.85

Calls 3

load_file_to_bytesFunction · 0.85
fprintfFunction · 0.85

Tested by

no test coverage detected