(image, text)
| 150 | |
| 151 | |
| 152 | def get_visual_ppl(image, text): |
| 153 | |
| 154 | img_uri = pil_to_data_uri(image, fmt="PNG") |
| 155 | content = [ |
| 156 | {"type": "text", "text": text}, |
| 157 | {"type": "image_url", "image_url": {"url": img_uri}}, |
| 158 | ] |
| 159 | |
| 160 | return compute_vlm_ppl(content) |
| 161 | |
| 162 | def estimate_visual_tokens( |
| 163 | images, |
no test coverage detected