AQIT
0.1.0
Toggle main menu visibility
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."""
3
from
__future__
import
annotations
4
5
import
logging
6
import
os
7
import
warnings
8
9
_installed =
False
10
11
12
def
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)
aquin.quiet.install_cli_quiet_mode
None install_cli_quiet_mode()
Definition
quiet.py:16
aquin
quiet.py
AQIT · Aquin Labs Private Limited · Apache 2.0 · Generated by
1.18.0