Skip to content

Commit

Permalink
mark integration test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
raspawar committed Jan 2, 2025
1 parent 86f08f7 commit 0c2cbb7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def test_basic(model: str, mode: dict) -> None:


## ================== nvidia/llama-3.2-nv-embedqa-1b-v2 model dimensions param test cases ==================
@pytest.mark.integration()
@pytest.mark.parametrize("dimensions", [32, 64, 128, 2048])
def test_embed_text_with_dimensions(mode: dict, dimensions: int) -> None:
model = "nvidia/llama-3.2-nv-embedqa-1b-v2"
Expand All @@ -21,6 +22,7 @@ def test_embed_text_with_dimensions(mode: dict, dimensions: int) -> None:
assert len(embedding.get_query_embedding(query)) == dimensions


@pytest.mark.integration()
@pytest.mark.parametrize("dimensions", [32, 64, 128, 2048])
def test_embed_query_with_dimensions(dimensions: int) -> None:
model = "nvidia/llama-3.2-nv-embedqa-1b-v2"
Expand All @@ -29,6 +31,7 @@ def test_embed_query_with_dimensions(dimensions: int) -> None:
assert len(embedding.get_query_embedding(query)) == dimensions


@pytest.mark.integration()
@pytest.mark.parametrize("dimensions", [102400])
def test_embed_query_with_large_dimensions(dimensions: int) -> None:
model = "nvidia/llama-3.2-nv-embedqa-1b-v2"
Expand All @@ -37,6 +40,7 @@ def test_embed_query_with_large_dimensions(dimensions: int) -> None:
assert 2048 <= len(embedding.get_query_embedding(query)) < dimensions


@pytest.mark.integration()
@pytest.mark.parametrize("dimensions", [102400])
def test_embed_documents_with_large_dimensions(dimensions: int) -> None:
model = "nvidia/llama-3.2-nv-embedqa-1b-v2"
Expand All @@ -47,6 +51,7 @@ def test_embed_documents_with_large_dimensions(dimensions: int) -> None:
assert all(2048 <= len(doc) < dimensions for doc in output)


@pytest.mark.integration()
@pytest.mark.parametrize("dimensions", [-1])
def test_embed_query_invalid_dimensions(dimensions: int) -> None:
model = "nvidia/llama-3.2-nv-embedqa-1b-v2"
Expand All @@ -56,6 +61,7 @@ def test_embed_query_invalid_dimensions(dimensions: int) -> None:
assert "400" in str(exc.value)


@pytest.mark.integration()
@pytest.mark.parametrize("dimensions", [-1])
def test_embed_documents_invalid_dimensions(dimensions: int) -> None:
model = "nvidia/llama-3.2-nv-embedqa-1b-v2"
Expand Down

0 comments on commit 0c2cbb7

Please sign in to comment.