Skip to content
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

Add PDFParser #187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

merveenoyan
Copy link

@merveenoyan merveenoyan commented Jan 14, 2025

This PR adds PDFParsingTool with GOT-OCR 2.0.

Note that this model isn't yet integrated with transformers (there's a PR for it), I don't know when it will be merged hence loading with trust_remote_code and not using PipelineTool. (they implemented custom methods to do forward that abstracts away a bunch of things, I used it)
How should we take file inputs? Now we only take path.
An issue with this model is that it comes with two extra dependencies: tiktoken and verovio.
We could add extra dependencies for this tool like pip install smolagents["pdf"].

WDYT? @aymeric-roucher

@merveenoyan
Copy link
Author

Partially fixes #176

@aymeric-roucher
Copy link
Collaborator

@merveenoyan thank you for this addition!
Does this tool require additional imports?
Also, couldn't the tool name be PdfReader to be more explicit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants