Skip to content

Commit

Permalink
reset accelerate env variables after each test (#24107)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman100 authored and sgugger committed Jun 8, 2023
1 parent 905892f commit 17db177
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/transformers/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,11 @@ def tearDown(self):
AcceleratorState._reset_state()
PartialState._reset_state()

# delete all the env variables having `ACCELERATE` in them
for k in list(os.environ.keys()):
if "ACCELERATE" in k:
del os.environ[k]


def mockenv(**kwargs):
"""
Expand Down

0 comments on commit 17db177

Please sign in to comment.