Skip to content
Snippets Groups Projects
Unverified Commit e1000551 authored by Asia's avatar Asia Committed by GitHub
Browse files

[FIX]Fix a NameError for llama-index-embeddings-clip (#10974)

parent 069f2c19
No related branches found
No related tags found
No related merge requests found
...@@ -131,6 +131,8 @@ class ClipEmbedding(MultiModalEmbedding): ...@@ -131,6 +131,8 @@ class ClipEmbedding(MultiModalEmbedding):
return self._get_image_embedding(img_file_path) return self._get_image_embedding(img_file_path)
def _get_image_embedding(self, img_file_path: ImageType) -> Embedding: def _get_image_embedding(self, img_file_path: ImageType) -> Embedding:
import torch
with torch.no_grad(): with torch.no_grad():
image = ( image = (
self._preprocess(Image.open(img_file_path)) self._preprocess(Image.open(img_file_path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment