-
Notifications
You must be signed in to change notification settings - Fork 902
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
fix: Introduce Image format options in CLI. Silence the tqdm downloading messages. #544
Conversation
…ine_options. Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Signed-off-by: Nikos Livathinos <[email protected]>
# Disable tqdm prints used by HF | ||
from tqdm import tqdm | ||
|
||
tqdm.__init__ = partialmethod(tqdm.__init__, disable=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't monkey patch, the HF library has specific options for it already
https://huggingface.co/docs/huggingface_hub/v0.26.5/en/package_reference/file_download#huggingface_hub.snapshot_download.tqdm_class
Signed-off-by: Nikos Livathinos <[email protected]>
Maybe one more check to do is, if the input format is an image, OCR must be activated for its pipeline options (independent of the global OCR choice) |
…ing messages. (DS4SD#544) * fix: main: Introduce format options for Image with the same pdf pipeline_options. Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions Signed-off-by: Nikos Livathinos <[email protected]> * fix: Silence the tqdm messages during the downloading of model files Signed-off-by: Nikos Livathinos <[email protected]> * fix: Code styling Signed-off-by: Nikos Livathinos <[email protected]> * fix: Use the HF API to disable the tqdm progress bars Signed-off-by: Nikos Livathinos <[email protected]> --------- Signed-off-by: Nikos Livathinos <[email protected]>
…ing messages. (#544) * fix: main: Introduce format options for Image with the same pdf pipeline_options. Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions Signed-off-by: Nikos Livathinos <[email protected]> * fix: Silence the tqdm messages during the downloading of model files Signed-off-by: Nikos Livathinos <[email protected]> * fix: Code styling Signed-off-by: Nikos Livathinos <[email protected]> * fix: Use the HF API to disable the tqdm progress bars Signed-off-by: Nikos Livathinos <[email protected]> --------- Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
This is a fix to:
pipeline_options
as for PDF. This allows the CLI parameters to be applied in case of image inputs.RapidOcrOptions
to the Union ofocr_options
forPdfPipelineOptions
.Issues resolved by this Pull Request:
Resolves #505 #208
Checklist: