Skip to content

Commit 202e6c1

Browse files
Update dynamic env handling to preserve None when USE_DYNAMIC is unset (#3567)
* Update dynamic env handling to preserve None when USE_DYNAMIC is unset * Apply suggestions from code review --------- Co-authored-by: Ilyas Moutawwakil <[email protected]>
1 parent 3287425 commit 202e6c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/accelerate/utils/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ def __post_init__(self):
10201020
self.mode = os.environ.get(prefix + "MODE", "default")
10211021
if self.fullgraph is None:
10221022
self.fullgraph = str_to_bool(os.environ.get(prefix + "USE_FULLGRAPH", "False")) == 1
1023-
if self.dynamic is None:
1023+
if self.dynamic is None and os.environ.get(prefix + "USE_DYNAMIC", None) is not None:
10241024
self.dynamic = str_to_bool(os.environ.get(prefix + "USE_DYNAMIC", "False")) == 1
10251025

10261026
def to_dict(self):

0 commit comments

Comments
 (0)