I've been testing Chainlit and the Llava cookbook.
file.content is empty using the llava example from the cookbook:
image = next(
(
Image.open(io.BytesIO(file.content))
for file in message.elements or []
if "image" in file.mime
),
None,
)
I had to change it to read the full file path instead:
async def main(message: cl.Message):
image = next(
(
Image.open(file.path)
for file in message.elements or []
if "image" in file.mime and file.path is not None
),
None,
)
Is the file.content bytes supposed to be stored in the file object as well? If so there is an issue saving it:
element.py
@dataclass
class Element:
# The byte content of the element.
content: Optional[Union[bytes, str]] = None
Greetings,
I've been testing Chainlit and the Llava cookbook.
file.content is empty using the llava example from the cookbook:
I had to change it to read the full file path instead:
Is the file.content bytes supposed to be stored in the file object as well? If so there is an issue saving it:
element.py
emitter.py https://github.com/Chainlit/chainlit/blob/5f7f104bb66d7b94dfc692cd8f27bfad17bac179/backend/chainlit/emitter.py#L213
file_elements Image content is empty:
Thanks!