vLLM example for 'Offline' should include an input image.
The vLLM example for 'Offline' unfortunately does not teach how to use the model with an input image, which is the key feature of this model. Would be nice to have an example showing how to insert the input image, especially directly from a PIL Image.
I tried many ways without success.
Thanks for any help.
i had the same problem
a solution i found on youtube was working with the data URI scheme
for python:
"""
from PIL import Image
import base64
import io
def format_image(path: str):
with Image.open(path).convert("RGB") as img:
buffered = io.BytesIO()
img.save(buffered, format="PNG")
img_base64 = base64.b64encode(buffered.getvalue()).decode('utf-8')
image_data_uri = f'data:image/png;base64,{img_base64}'
return image_data_uri
"""
use the image_data_uri as url
sorry, no idea how to format this properly
Fantastic. Solves the problem. Much appreciated!