AQIT 0.1.0
Loading...
Searching...
No Matches
quiet.py
Go to the documentation of this file.
1# Copyright (c) 2025-present Aquin Labs Private Limited. All Rights Reserved.
2"""Suppress noisy third-party logs/warnings on the Aquin CLI."""
3from __future__ import annotations
4
5import logging
6import os
7import warnings
8
9_installed = False
10
11
12def install_cli_quiet_mode() -> None:
13 global _installed
14 if _installed:
15 return
16 _installed = True
17
18 os.environ.setdefault("HF_HUB_DISABLE_PROGRESS_BARS", "1")
19 os.environ.setdefault("TRANSFORMERS_NO_ADVISORY_WARNINGS", "1")
20 os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
21
22 warnings.filterwarnings("ignore", message=".*from_pretrained_no_processing.*")
23 warnings.filterwarnings("ignore", message=".*reduced precision.*")
24
25 for name in (
26 "transformers",
27 "transformers.modeling_utils",
28 "huggingface_hub",
29 "huggingface_hub.utils",
30 "urllib3",
31 "root",
32 ):
33 logging.getLogger(name).setLevel(logging.ERROR)
None install_cli_quiet_mode()
Definition quiet.py:16