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

[vertex] Add PDF/plein texts support #1520

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

ArthurGoupil
Copy link
Contributor

@ArthurGoupil ArthurGoupil commented Oct 14, 2024

Following this issue #1505, adding PDF and plain text support to Vertex.

The basis has also been setup for other endpoints that would support inline documents.

DEMO

Enregistrement.de.l.ecran.2024-10-14.a.18.51.24.mov
Capture d’écran 2024-10-15 à 09 54 56

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document processor might be enriched when specific needs will arise in the future

],
preferredMimeType: "image/webp",
maxSizeInMB: Infinity,
maxSizeInMB: 20,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vertex supports 20mb of inline files

@@ -213,7 +213,7 @@
...(!$page.data?.assistant && currentModel.tools
? activeTools.flatMap((tool: ToolFront) => tool.mimeTypes ?? [])
: []),
...(currentModel.multimodal ? ["image/*"] : []),
...(currentModel.multimodal ? currentModel.multimodalAcceptedMimetypes ?? ["image/*"] : []),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefered to allow passing specific mimetypes rather than adding a quite specific option enableDocumentParsing

Copy link
Contributor

@pocman pocman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great !

@ArthurGoupil ArthurGoupil changed the title [vertex] Add PDF support [vertex] Add PDF/plein texts support Oct 15, 2024
@nsarrazin
Copy link
Collaborator

Thanks a lot, looks like a great PR! going to take a look 😄

Copy link
Collaborator

@nsarrazin nsarrazin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good ! thanks for making multimodalAcceptedMimetypes backwards compatible 😄

@nsarrazin nsarrazin merged commit cc5dfd4 into huggingface:main Oct 15, 2024
3 checks passed
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.

3 participants