import os
import sys
import pytest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from perf.config import get_model_name, get_model_dimension
@pytest.fixture(scope="session")
def model_name() -> str:
return get_model_name()
@pytest.fixture(scope="session")
def model_dimension() -> int:
return get_model_dimension()
@pytest.fixture
def sample_text() -> str:
return "Hello, world! This is a test."
@pytest.fixture
def sample_texts() -> list:
return [
"Hello world",
"Machine learning is great",
"Artificial intelligence is the future",
]
@pytest.fixture
def short_text() -> str:
return "AI"
@pytest.fixture
def chinese_text() -> str:
return "你好世界"
@pytest.fixture
def long_text() -> str:
return (
"Machine learning is a subset of artificial intelligence that enables "
"systems to learn and improve from experience without being explicitly "
"programmed. It focuses on developing computer programs that can access "
"data and use it to learn for themselves."
)
@pytest.fixture
def special_char_text() -> str:
return "Hello! @#$% &*() World"