Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ImageReward/ImageReward.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def score(self, prompt, image):
elif isinstance(image, str) and os.path.isfile(image):
pil_image = Image.open(image)
else:
raise TypeError(r'This image parameter type has not been supportted yet. Please pass PIL.Image or file path str.')
raise TypeError(r'This image parameter type has not been supported yet. Please pass PIL.Image or file path str.')

image = self.preprocess(pil_image).unsqueeze(0).to(self.device)
image_embeds = self.blip.visual_encoder(image)
Expand Down Expand Up @@ -149,7 +149,7 @@ def inference_rank(self, prompt, generations_list):
if os.path.isfile(generation):
pil_image = Image.open(generation)
else:
raise TypeError(r'This image parameter type has not been supportted yet. Please pass PIL.Image or file path str.')
raise TypeError(r'This image parameter type has not been supported yet. Please pass PIL.Image or file path str.')
image = self.preprocess(pil_image).unsqueeze(0).to(self.device)
image_embeds = self.blip.visual_encoder(image)

Expand Down