Skip to content
Snippets Groups Projects
Unverified Commit 6be31413 authored by James Briggs's avatar James Briggs
Browse files

lint

parent 037b59f9
Branches
Tags
Loading
...@@ -66,7 +66,7 @@ class CLIPEncoder(BaseEncoder): ...@@ -66,7 +66,7 @@ class CLIPEncoder(BaseEncoder):
"You can install it with: " "You can install it with: "
"`pip install semantic-router[vision]`" "`pip install semantic-router[vision]`"
) )
try: try:
from PIL import Image from PIL import Image
except ImportError: except ImportError:
...@@ -114,7 +114,7 @@ class CLIPEncoder(BaseEncoder): ...@@ -114,7 +114,7 @@ class CLIPEncoder(BaseEncoder):
embeds = self._model.get_image_features(pixel_values=inputs) embeds = self._model.get_image_features(pixel_values=inputs)
embeds = embeds.squeeze(0).cpu().detach().numpy() embeds = embeds.squeeze(0).cpu().detach().numpy()
return embeds return embeds
def _ensure_rgb(self, img: Any): def _ensure_rgb(self, img: Any):
rgbimg = self._Image.new("RGB", img.size) rgbimg = self._Image.new("RGB", img.size)
rgbimg.paste(img) rgbimg.paste(img)
......
...@@ -41,7 +41,7 @@ class VitEncoder(BaseEncoder): ...@@ -41,7 +41,7 @@ class VitEncoder(BaseEncoder):
"You can install it with: " "You can install it with: "
"`pip install semantic-router[vision]`" "`pip install semantic-router[vision]`"
) )
try: try:
from PIL import Image from PIL import Image
except ImportError: except ImportError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment