mirror of
https://github.com/ggozad/oterm.git
synced 2026-10-19 13:41:26 +02:00
24 lines
548 B
Python
24 lines
548 B
Python
from base64 import b64encode
|
|
from io import BytesIO
|
|
|
|
import ollama
|
|
import pytest
|
|
import pytest_asyncio
|
|
from PIL import Image
|
|
|
|
|
|
@pytest_asyncio.fixture(autouse=True)
|
|
async def load_test_models():
|
|
try:
|
|
ollama.show("nous-hermes:13b")
|
|
except ollama.ResponseError:
|
|
ollama.pull("nous-hermes:13b")
|
|
yield
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def llama_image():
|
|
buffered = BytesIO()
|
|
image = Image.open("tests/data/lama.jpg")
|
|
image.save(buffered, format="JPEG")
|
|
return b64encode(buffered.getvalue()).decode("utf-8")
|