From 96c574425df7ef234d87815d44cffd30178ec0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Mon, 7 Nov 2022 09:27:07 +0100 Subject: [PATCH] Update path type annotation for load_from_checkpoint (#15540) --- src/pytorch_lightning/core/saving.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pytorch_lightning/core/saving.py b/src/pytorch_lightning/core/saving.py index 0c314e5d56..009a3e9664 100644 --- a/src/pytorch_lightning/core/saving.py +++ b/src/pytorch_lightning/core/saving.py @@ -59,9 +59,9 @@ class ModelIO: @classmethod def load_from_checkpoint( cls, - checkpoint_path: Union[str, IO], + checkpoint_path: Union[_PATH, IO], map_location: _MAP_LOCATION_TYPE = None, - hparams_file: Optional[str] = None, + hparams_file: Optional[_PATH] = None, strict: bool = True, **kwargs: Any, ) -> Self: # type: ignore[valid-type]