diff --git a/libs/partners/openai/tests/integration_tests/embeddings/test_azure.py b/libs/partners/openai/tests/integration_tests/embeddings/test_azure.py index 5bf5e7a2480..18644ee66aa 100644 --- a/libs/partners/openai/tests/integration_tests/embeddings/test_azure.py +++ b/libs/partners/openai/tests/integration_tests/embeddings/test_azure.py @@ -117,7 +117,7 @@ def test_azure_openai_embedding_with_empty_string() -> None: .data[0] .embedding ) - assert np.allclose(output[0], expected_output, atol=0.0001) + assert np.allclose(output[0], expected_output, atol=0.001) assert len(output[1]) == 1536 diff --git a/libs/partners/openai/tests/integration_tests/embeddings/test_base.py b/libs/partners/openai/tests/integration_tests/embeddings/test_base.py index ef16dd2f48a..321edcfc0fb 100644 --- a/libs/partners/openai/tests/integration_tests/embeddings/test_base.py +++ b/libs/partners/openai/tests/integration_tests/embeddings/test_base.py @@ -2,7 +2,6 @@ import numpy as np import openai -import pytest from langchain_openai.embeddings.base import OpenAIEmbeddings @@ -33,7 +32,6 @@ def test_langchain_openai_embeddings_dimensions() -> None: assert len(output[0]) == 128 -@pytest.mark.skip(reason="flaky") def test_langchain_openai_embeddings_equivalent_to_raw() -> None: documents = ["disallowed special token '<|endoftext|>'"] embedding = OpenAIEmbeddings() @@ -45,10 +43,9 @@ def test_langchain_openai_embeddings_equivalent_to_raw() -> None: .data[0] .embedding ) - assert np.isclose(lc_output, direct_output).all() + assert np.allclose(lc_output, direct_output, atol=0.001) -@pytest.mark.skip(reason="flaky") async def test_langchain_openai_embeddings_equivalent_to_raw_async() -> None: documents = ["disallowed special token '<|endoftext|>'"] embedding = OpenAIEmbeddings() @@ -60,7 +57,7 @@ async def test_langchain_openai_embeddings_equivalent_to_raw_async() -> None: .data[0] .embedding ) - assert np.isclose(lc_output, direct_output).all() + assert np.allclose(lc_output, direct_output, atol=0.001) def test_langchain_openai_embeddings_dimensions_large_num() -> None: