From bb83bc3f8d3506c06ffa886f39d51b463e339af8 Mon Sep 17 00:00:00 2001 From: Nikos Livathinos Date: Mon, 9 Dec 2024 14:25:18 +0100 Subject: [PATCH] fix: Use the HF API to disable the tqdm progress bars Signed-off-by: Nikos Livathinos --- docling/pipeline/standard_pdf_pipeline.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docling/pipeline/standard_pdf_pipeline.py b/docling/pipeline/standard_pdf_pipeline.py index 42ce238f..6f5e1542 100644 --- a/docling/pipeline/standard_pdf_pipeline.py +++ b/docling/pipeline/standard_pdf_pipeline.py @@ -96,15 +96,10 @@ class StandardPdfPipeline(PaginatedPipeline): def download_models_hf( local_dir: Optional[Path] = None, force: bool = False ) -> Path: - from functools import partialmethod - from huggingface_hub import snapshot_download + from huggingface_hub.utils import disable_progress_bars - # Disable tqdm prints used by HF - from tqdm import tqdm - - tqdm.__init__ = partialmethod(tqdm.__init__, disable=True) - + disable_progress_bars() download_path = snapshot_download( repo_id="ds4sd/docling-models", force_download=force,