mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-08-29 02:46:39 +00:00

* add generators module * add tests for module helper * reno * add another test * move into openai * improve tests
14 lines
300 B
Python
14 lines
300 B
Python
from unittest.mock import Mock
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture()
|
|
def mock_tokenizer():
|
|
"""
|
|
Tokenizes the string by splitting on spaces.
|
|
"""
|
|
tokenizer = Mock()
|
|
tokenizer.encode = lambda text: text.split()
|
|
tokenizer.decode = lambda tokens: " ".join(tokens)
|
|
return tokenizer
|