Files
wehub-resource-sync 86db9aae8e
Documentation / build (push) Has been cancelled
Documentation / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:34:55 +08:00

20 lines
564 B
Python

""" This example shows how to use multimedia vision-to-text model with onnxruntime -
to run, pip install onnxruntime_genai
"""
from llmware.models import ModelCatalog
model = ModelCatalog().load_model("phi-3-vision-onnx")
# supported image types: jpg, png
img_path = "/path/to/local/image"
# to run a streaming response
for token in model.stream("Describe this image",img_path):
print(token, end="")
# to get a complete response upon completion only
response = model.inference("Describe this image", img_path)
print("--vision response - ", response)