diff --git a/swarms/models/__init__.py b/swarms/models/__init__.py index b7f3b8ce..33870b31 100644 --- a/swarms/models/__init__.py +++ b/swarms/models/__init__.py @@ -1,8 +1,3 @@ -import sys - -log_file = open("errors.txt", "w") -sys.stderr = log_file - # LLMs from swarms.models.anthropic import Anthropic # noqa: E402 from swarms.models.petals import Petals # noqa: E402 diff --git a/swarms/utils/disable_logging.py b/swarms/utils/disable_logging.py index d1c7df9b..93e59bb5 100644 --- a/swarms/utils/disable_logging.py +++ b/swarms/utils/disable_logging.py @@ -1,9 +1,12 @@ import logging import os import warnings - +import sys def disable_logging(): + log_file = open("errors.txt", "w") + sys.stderr = log_file + warnings.filterwarnings("ignore", category=UserWarning) # disable tensorflow warnings