clean up wandb import, remove deprecated warnings handling

This commit is contained in:
Laurent 2024-10-15 13:19:05 +00:00 committed by Laureηt
parent 241abfafe4
commit c5d3d1c657

View file

@ -1,19 +1,14 @@
import warnings
from abc import ABC from abc import ABC
from pathlib import Path from pathlib import Path
from typing import Any, Literal from typing import Any, Literal
import wandb
from PIL import Image from PIL import Image
from refiners.training_utils.callback import Callback, CallbackConfig from refiners.training_utils.callback import Callback, CallbackConfig
from refiners.training_utils.config import BaseConfig from refiners.training_utils.config import BaseConfig
from refiners.training_utils.trainer import Trainer, register_callback from refiners.training_utils.trainer import Trainer, register_callback
with warnings.catch_warnings():
# TODO: remove when https://github.com/wandb/wandb/issues/6711 gets solved
warnings.filterwarnings("ignore", category=DeprecationWarning, message="pkg_resources is deprecated as an API")
import wandb
number = float | int number = float | int
WandbLoggable = number | Image.Image | list[number] | dict[str, list[number]] WandbLoggable = number | Image.Image | list[number] | dict[str, list[number]]