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

Function remove_image_from_prompt

examples/llava/llava-cli.cpp:159–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159static std::string remove_image_from_prompt(const std::string& prompt, const char * replacement = "") {
160 size_t begin, end;
161 find_image_tag_in_prompt(prompt, begin, end);
162 if (begin == std::string::npos || end == std::string::npos) {
163 return prompt;
164 }
165 auto pre = prompt.substr(0, begin);
166 auto post = prompt.substr(end + strlen(IMG_BASE64_TAG_END));
167 return pre + replacement + post;
168}
169
170struct llava_context {
171 struct clip_ctx * ctx_clip = NULL;

Callers 1

load_imageFunction · 0.85

Calls 2

find_image_tag_in_promptFunction · 0.85
substrMethod · 0.80

Tested by

no test coverage detected