Skip to content

Commit

Permalink
πŸ”„ Refactor image analysis test
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jan 25, 2024
1 parent a424127 commit dc9a8de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ollama_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from funcchain import chain, settings
from PIL import Image
from funcchain import Image, chain, settings
from pydantic import BaseModel, Field


Expand Down Expand Up @@ -45,7 +44,7 @@ class Analysis(BaseModel):
objects: list[str] = Field(description="A list of objects found in the image")


def analyse(image: Image.Image) -> Analysis:
def analyse(image: Image) -> Analysis:
"""
Analyse the image and extract its
theme, description and objects.
Expand All @@ -56,9 +55,10 @@ def analyse(image: Image.Image) -> Analysis:
@pytest.mark.skip_on_actions
def test_vision() -> None:
settings.llm = "ollama/bakllava"
settings.console_stream = True

assert isinstance(
analyse(Image.open("examples/assets/old_chinese_temple.jpg")),
analyse(Image.from_file("examples/assets/old_chinese_temple.jpg")),
Analysis,
) # todo check actual output

Expand Down

0 comments on commit dc9a8de

Please sign in to comment.