Skip to content

Commit

Permalink
Internal changes
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 615088561
  • Loading branch information
yifenglou authored and langfun authors committed Mar 12, 2024
1 parent 98f3a63 commit dc93911
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion langfun/core/modalities/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def mime_type(self) -> str:
return f'image/{self.image_format}'

def _repr_html_(self) -> str:
if self.uri:
if self.uri and self.uri.lower().startswith(('http:', 'https:', 'ftp:')):
return f'<img src="{self.uri}">'
image_raw = base64.b64encode(self.to_bytes()).decode()
return f'<img src="data:image/{self.image_format};base64,{image_raw}">'

0 comments on commit dc93911

Please sign in to comment.