From 82dba4b9bc91ebd4c321e6a76ef4c5d2ffdede8a Mon Sep 17 00:00:00 2001 From: EvensXia Date: Wed, 30 Oct 2024 09:56:35 +0800 Subject: [PATCH] revert llm_vision --- examples/llm_vision.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/llm_vision.py b/examples/llm_vision.py index 1bfbfb230..eea6550f6 100644 --- a/examples/llm_vision.py +++ b/examples/llm_vision.py @@ -14,11 +14,9 @@ async def main(): # check if the configured llm supports llm-vision capacity. If not, it will throw a error invoice_path = Path(__file__).parent.joinpath("..", "tests", "data", "invoices", "invoice-2.png") - encode_image(invoice_path) - # res = await llm.aask(msg="return `True` if this image might be a invoice, or return `False`", images=[img_base64]) - res = await llm.aask(msg="hello") - print(res) - # assert ("true" in res.lower()) or ("invoice" in res.lower()) + img_base64 = encode_image(invoice_path) + res = await llm.aask(msg="return `True` if this image might be a invoice, or return `False`", images=[img_base64]) + assert ("true" in res.lower()) or ("invoice" in res.lower()) if __name__ == "__main__":