|
19 | 19 | import logging |
20 | 20 | import os |
21 | 21 | from argparse import Namespace |
22 | | -from typing import TYPE_CHECKING, Any, Dict, Literal, Mapping, Optional, Union |
| 22 | +from collections.abc import Mapping |
| 23 | +from typing import TYPE_CHECKING, Any, Literal, Optional, Union |
23 | 24 |
|
24 | 25 | from lightning_utilities.core.imports import RequirementCache |
25 | 26 | from torch import Tensor |
@@ -261,7 +262,7 @@ def __init__( |
261 | 262 | self._project_name: Optional[str] = project |
262 | 263 | self._experiment_key: Optional[str] = experiment_key |
263 | 264 | self._prefix: Optional[str] = prefix |
264 | | - self._kwargs: Dict[str, Any] = kwargs |
| 265 | + self._kwargs: dict[str, Any] = kwargs |
265 | 266 |
|
266 | 267 | # needs to be set before the first `comet_ml` import |
267 | 268 | # because comet_ml imported after another machine learning libraries (Torch) |
@@ -318,7 +319,7 @@ def experiment(self) -> comet_experiment: |
318 | 319 |
|
319 | 320 | @override |
320 | 321 | @rank_zero_only |
321 | | - def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None: |
| 322 | + def log_hyperparams(self, params: Union[dict[str, Any], Namespace]) -> None: |
322 | 323 | params = _convert_params(params) |
323 | 324 | self.experiment.__internal_api__log_parameters__( |
324 | 325 | parameters=params, |
@@ -394,7 +395,7 @@ def version(self) -> Optional[str]: |
394 | 395 | if self._experiment is not None: |
395 | 396 | return self._experiment.get_key() |
396 | 397 |
|
397 | | - def __getstate__(self) -> Dict[str, Any]: |
| 398 | + def __getstate__(self) -> dict[str, Any]: |
398 | 399 | state = self.__dict__.copy() |
399 | 400 |
|
400 | 401 | # Save the experiment id in case an experiment object already exists, |
|
0 commit comments