-
-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle single files, pdfs, errors from missing loader dependencies in /learn
#733
Handle single files, pdfs, errors from missing loader dependencies in /learn
#733
Conversation
(1) Enables handling single files, not just directories. (2) Learns PDFs with langchain's PyPDFLoader. (3) Gives a clean error w/o traceback when the file type that is being handled needs addtional packages.
for more information, see https://pre-commit.ci
Removed the extra attribute and additional response comments based on feedback from Piyush Jain and Andrii Ieroshenko
…//github.com/srdas/jupyter-ai into handle_single-files_pdfs_install-pypdf-error
Made the error message more generic as there are many different failure types.
@srdas pip install pre-commit
pre-commit install |
Thanks @3coins for your support. |
@meeseeksdev please backport to 1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…ssing loader dependencies in `/learn`
…er dependencies in `/learn` (#744) Co-authored-by: Sanjiv Das <[email protected]>
… `/learn` (jupyterlab#733) * Handle single files, pdfs, errors (1) Enables handling single files, not just directories. (2) Learns PDFs with langchain's PyPDFLoader. (3) Gives a clean error w/o traceback when the file type that is being handled needs addtional packages. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * error handling for missing packages in learn.py Removed the extra attribute and additional response comments based on feedback from Piyush Jain and Andrii Ieroshenko * Amend error message for failure in learn.py Made the error message more generic as there are many different failure types. * Fixed build error. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Piyush Jain <[email protected]>
Improves on PR #712
This PR makes the following enhancements:
PyPDFLoader
. In PR Handle Single Files and also enable html, pdf file formats for /learn #712, thepypdf
package was directly used instead ofPyPDFLoader
, which also depends onpypdf
.pypdf
was added as a required dependency, this has been changed to make it an optional dependency in [all].pypdf
is not installed, the full missing package error with traceback is displayed, which is poor UX. Modifiedlearn.py
to return a clean error with the missing package name, w/o traceback. The error handling for a missing dependency is generic and does not depend on specific packages, and is displayed when the file type that is being handled needs additional packages.Here is an example of the error when
pypdf
is not installed.Here is an example of handling a single PDF file after
pypdf
is installed.