From 6a18b8122fcde19d624e197ef01954e749a9f4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mentine?= Date: Wed, 18 Dec 2024 11:58:53 +0100 Subject: [PATCH] logging fix --- src/lighteval/__main__.py | 5 +++-- src/lighteval/models/transformers/transformers_model.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lighteval/__main__.py b/src/lighteval/__main__.py index 4484f781..e4053813 100644 --- a/src/lighteval/__main__.py +++ b/src/lighteval/__main__.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import logging -from logging.config import dictConfig +import logging.config import colorlog import typer @@ -57,7 +57,8 @@ }, ) -dictConfig(logging_config) +logging.config.dictConfig(logging_config) +logging.captureWarnings(capture=True) app.command(rich_help_panel="Evaluation Backends")(lighteval.main_accelerate.accelerate) app.command(rich_help_panel="Evaluation Utils")(lighteval.main_baseline.baseline) diff --git a/src/lighteval/models/transformers/transformers_model.py b/src/lighteval/models/transformers/transformers_model.py index 19ead82c..295ed4b1 100644 --- a/src/lighteval/models/transformers/transformers_model.py +++ b/src/lighteval/models/transformers/transformers_model.py @@ -22,6 +22,7 @@ import logging import os +import warnings from dataclasses import dataclass from typing import Optional, Tuple, Union