oterm/tests/conftest.py
2023-10-14 11:25:51 +02:00

13 lines
306 B
Python

import pytest_asyncio
from oterm.ollama import OllamaAPI, OllamaError
@pytest_asyncio.fixture(autouse=True)
async def load_test_models():
api = OllamaAPI()
try:
await api.get_model_info("nous-hermes:13b")
except OllamaError:
await api.pull_model("nous-hermes:13b")
yield