Skip to content

Commit 4b47e0f

Browse files
CLI: resolve jsonargparse deprecation warning (#20802)
--------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9d93d77 commit 4b47e0f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lightning/pytorch/cli.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@
4545
Namespace,
4646
class_from_function,
4747
register_unresolvable_import_paths,
48-
set_config_read_mode,
4948
)
5049

5150
register_unresolvable_import_paths(torch) # Required until fix https://github.com/pytorch/pytorch/issues/74483
52-
set_config_read_mode(fsspec_enabled=True)
51+
52+
try:
53+
from jsonargparse import set_parsing_settings
54+
55+
set_parsing_settings(config_read_mode_fsspec_enabled=True)
56+
except ImportError:
57+
from jsonargparse import set_config_read_mode
58+
59+
set_config_read_mode(fsspec_enabled=True)
5360
else:
5461
locals()["ArgumentParser"] = object
5562
locals()["Namespace"] = object

0 commit comments

Comments
 (0)