mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-02 15:32:30 +00:00
fix: Use the HF API to disable the tqdm progress bars
Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
This commit is contained in:
parent
04977aac9f
commit
bb83bc3f8d
@ -96,15 +96,10 @@ class StandardPdfPipeline(PaginatedPipeline):
|
|||||||
def download_models_hf(
|
def download_models_hf(
|
||||||
local_dir: Optional[Path] = None, force: bool = False
|
local_dir: Optional[Path] = None, force: bool = False
|
||||||
) -> Path:
|
) -> Path:
|
||||||
from functools import partialmethod
|
|
||||||
|
|
||||||
from huggingface_hub import snapshot_download
|
from huggingface_hub import snapshot_download
|
||||||
|
from huggingface_hub.utils import disable_progress_bars
|
||||||
|
|
||||||
# Disable tqdm prints used by HF
|
disable_progress_bars()
|
||||||
from tqdm import tqdm
|
|
||||||
|
|
||||||
tqdm.__init__ = partialmethod(tqdm.__init__, disable=True)
|
|
||||||
|
|
||||||
download_path = snapshot_download(
|
download_path = snapshot_download(
|
||||||
repo_id="ds4sd/docling-models",
|
repo_id="ds4sd/docling-models",
|
||||||
force_download=force,
|
force_download=force,
|
||||||
|
Loading…
Reference in New Issue
Block a user