| 157 | } |
| 158 | |
| 159 | static 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 | |
| 170 | struct llava_context { |
| 171 | struct clip_ctx * ctx_clip = NULL; |
no test coverage detected