Skip to content

Commit

Permalink
reset accelerate env variables after each test (huggingface#24107)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman100 authored and novice03 committed Jun 23, 2023
1 parent 236db9e commit 2e27e48
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 2e27e48

Please sign in to comment.