Skip to content

Commit

Permalink
chore: solve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
guenthermi committed Sep 24, 2024
2 parents 4ca4204 + 70f81cb commit 11ad8d9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_chunking_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,21 @@ def test_chunk_by_tokens():
assert end - start <= 10


def test_chunk_semantically():
@pytest.mark.parametrize(
'model_name',
['jinaai/jina-embeddings-v2-small-en', 'sentence-transformers/all-MiniLM-L6-v2'],
)
def test_chunk_semantically(model_name):
chunker = Chunker(chunking_strategy="semantic")
tokenizer = AutoTokenizer.from_pretrained('jinaai/jina-embeddings-v2-small-en')
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokens = tokenizer.encode_plus(
EXAMPLE_TEXT_1, add_special_tokens=False, return_offsets_mapping=True
)
boundary_cues = chunker.chunk(
EXAMPLE_TEXT_1,
tokenizer=tokenizer,
chunking_strategy='semantic',
embedding_model_name='jinaai/jina-embeddings-v2-small-en',
embedding_model_name=model_name,
)

# check if it returns boundary cues
Expand Down

0 comments on commit 11ad8d9

Please sign in to comment.