Closed poojitharamachandra closed 1 year ago
What version of chainlit are you using? You can run pip show chainlit to find out
chainlit==0.4.101
Yes this is an old version. Try run pip install -U chainlit to upgrade
even with 0.6.3, the same issue exists.
Are you sure you are running the correct version of chainlit ? You might have multiple python version installed. You can try to start chainlit like that to make sure:
python -m chainlit run …
is this implemented in 0.6.3? Upload File button in front-end UI, just like OpenAI code interpretor · Issue #198 · Chainlit/chainlit (github.com)
I am able to read .txt file in 0.6.3(TypeError: argument of type 'AskFileResponse' is not iterable is not there anymore), but unable to read a pdf file. How do I correctly read a pdf file here?
Here is an example with langchain https://github.com/Chainlit/cookbook/blob/c65d989e90614da867fed2a4e06ad9330d95ff06/pdf-qa/app.py#L75 check the process_file function
thanks, i am still unable to process the content of pdf, as it contains special characters. none of the decoding techniques such as utf-8, latin-1,unicode etc are working
There are multiple python pdf loader packages available. You can probably find one that fit your need :)
is there any way to give the loader as input to AskFileMessage? Because, my default, AskFileMessage give data in form of bytes, which is causing problem for my usecase, as I have multiple special characters in the pdf.
hi,
is this implemented in 0.6.3? https://github.com/Chainlit/chainlit/issues/198
I don't think it is the responsibility of AskFileMessage
to parse the file. The developer should be able to use any loader from the received bytes.
hi,
is this implemented in 0.6.3? #198
This will be part of the next release.
Here is an example with langchain https://github.com/Chainlit/cookbook/blob/c65d989e90614da867fed2a4e06ad9330d95ff06/pdf-qa/app.py#L75 check the process_file function
is it possible to write the contents to a pdf/word file instead of a temp file?
To update an existing file or to create it from scratch? If you just want to create the file you can do
with open('output.pdf', 'wb') as f:
# Write the bytes to the file
f.write(file.content)
chainlit==0.7.400
version works for me
Since chainlit 1.0.0 this api changed slightly. Check this example
I am trying to upload a pdf file , but unable to read it.(the same code runs without any error if i upload a text file) here is the code:
TypeError: argument of type 'AskFileResponse' is not iterable