Skip to content

Commit

Permalink
fix after rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kdziedzic68 committed Oct 28, 2024
1 parent b98d5f1 commit c79db3e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ async def _to_image_element(

img_bytes = crop_and_convert_to_bytes(image, top_x, top_y, bottom_x, bottom_y)
prompt = _ImagePrompt(_ImagePromptInput(images=[img_bytes]))
image_description = await self.image_describer.get_image_description(prompt=prompt)
if self._llm:
image_description = await self._llm.generate(prompt=prompt)
elif self.image_describer:
image_description = await self.image_describer.get_image_description(prompt=prompt)
else:
image_description = ""
return ImageElement(
description=image_description,
ocr_extracted_text=element.text,
Expand Down

0 comments on commit c79db3e

Please sign in to comment.