reset accelerate env variables after each test (#24107)
This commit is contained in:
committed by
GitHub
parent
5fa0a1b23b
commit
0f23605094
@@ -1339,6 +1339,11 @@ class TestCasePlus(unittest.TestCase):
|
||||
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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user