-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Dec 16, 2023
1 parent
9e6bfeb
commit 06f02c6
Showing
4 changed files
with
46 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,13 @@ | ||
import logging | ||
import os | ||
import warnings | ||
|
||
# disable warnings | ||
|
||
warnings.filterwarnings("ignore") | ||
|
||
# disable tensorflow warnings | ||
|
||
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" | ||
|
||
# disable bnb warnings and others | ||
|
||
logging.getLogger().setLevel(logging.WARNING) | ||
|
||
|
||
class CustomFilter(logging.Filter): | ||
def filter(self, record): | ||
msg = "Created a temporary directory at" | ||
return msg not in record.getMessage() | ||
|
||
|
||
logger = logging.getLogger() | ||
f = CustomFilter() | ||
logger.addFilter(f) | ||
|
||
from zeta.nn import * | ||
from zeta.models import * | ||
from zeta.utils import * | ||
from zeta.training import * | ||
from zeta.tokenizers import * | ||
from zeta.rl import * | ||
from zeta.optim import * | ||
from zeta.ops import * | ||
from zeta.quant import * | ||
from zeta.utils.disable_logging import disable_warnings_and_logs | ||
|
||
disable_warnings_and_logs() | ||
|
||
from zeta.nn import * # noqa: F403, E402 | ||
from zeta.models import * # noqa: F403, E402 | ||
from zeta.utils import * # noqa: F403, E402 | ||
from zeta.training import * # noqa: F403, E402 | ||
from zeta.tokenizers import * # noqa: F403, E402 | ||
from zeta.rl import * # noqa: F403, E402 | ||
from zeta.optim import * # noqa: F403, E402 | ||
from zeta.ops import * # noqa: F403, E402 | ||
from zeta.quant import * # noqa: F403, E402 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import logging | ||
import os | ||
import warnings | ||
|
||
|
||
def disable_warnings_and_logs(): | ||
"""Disable warnings and logs. | ||
Returns: | ||
_type_: _description_ | ||
""" | ||
# disable warnings | ||
warnings.filterwarnings("ignore") | ||
|
||
# disable tensorflow warnings | ||
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" | ||
|
||
# disable bnb warnings and others | ||
logging.getLogger().setLevel(logging.WARNING) | ||
|
||
class CustomFilter(logging.Filter): | ||
def filter(self, record): | ||
msg = "Created a temporary directory at" | ||
return msg not in record.getMessage() | ||
|
||
logger = logging.getLogger() | ||
f = CustomFilter() | ||
logger.addFilter(f) | ||
|
||
|
||
disable_warnings_and_logs() |