Skip to content

Commit

Permalink
fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jmansdorfer committed Nov 8, 2024
1 parent 68b4f33 commit 2794790
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions libs/community/langchain_community/embeddings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@
from langchain_community.embeddings.ovhcloud import (
OVHCloudEmbeddings,
)
from langchain_community.embeddings.premai import (
PremAIEmbeddings,
)
from langchain_community.embeddings.predictionguard import (
PredictionGuardEmbeddings,
)
from langchain_community.embeddings.premai import (
PremAIEmbeddings,
)
from langchain_community.embeddings.sagemaker_endpoint import (
SagemakerEndpointEmbeddings,
)
Expand Down Expand Up @@ -304,6 +304,7 @@
"OpenVINOEmbeddings",
"OracleEmbeddings",
"OVHCloudEmbeddings",
"PredictionGuardEmbeddings",
"PremAIEmbeddings",
"QianfanEmbeddingsEndpoint",
"QuantizedBgeEmbeddings",
Expand Down Expand Up @@ -390,6 +391,7 @@
"QuantizedBiEncoderEmbeddings": "langchain_community.embeddings.optimum_intel",
"OracleEmbeddings": "langchain_community.embeddings.oracleai",
"OVHCloudEmbeddings": "langchain_community.embeddings.ovhcloud",
"PredictionGuardEmbeddings": "langchain_community.embeddings.predictionguard",
"SagemakerEndpointEmbeddings": "langchain_community.embeddings.sagemaker_endpoint",
"SambaStudioEmbeddings": "langchain_community.embeddings.sambanova",
"SelfHostedEmbeddings": "langchain_community.embeddings.self_hosted",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ def embed_image_text(self, inputs: List[Dict[str, str]]) -> List[float]:
else:
continue

return res
return res
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_predictionguard_embeddings_images() -> None:
"""Test Prediction Guard embeddings."""
embeddings = PredictionGuardEmbeddings(model="bridgetower-large-itm-mlm-itc")
image = [
"https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png",
"https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI",
]
output = embeddings.embed_images(image)
assert len(output) == 1
Expand All @@ -49,7 +49,7 @@ def test_predictionguard_embeddings_images_multiple() -> None:
embeddings = PredictionGuardEmbeddings(model="bridgetower-large-itm-mlm-itc")
images = [
"https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg",
"https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png",
"https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI",
]
output = embeddings.embed_images(images)
assert len(output) == 2
Expand All @@ -61,7 +61,7 @@ def test_predictionguard_embeddings_image_text() -> None:
inputs = [
{
"text": "embed me",
"image": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png",
"image": "https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI",
},
]
output = embeddings.embed_image_text(inputs)
Expand All @@ -74,12 +74,12 @@ def test_predictionguard_embeddings_image_text_multiple() -> None:
inputs = [
{
"text": "embed me",
"image": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png",
"image": "https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI",
},
{
"text": "embed this",
"image": "https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg",
},
]
output = embeddings.embed_image_text(inputs)
assert len(output) == 2
assert len(output) == 2

0 comments on commit 2794790

Please sign in to comment.