Add accelerate support for ViLT (#18683)

This commit is contained in:
Younes Belkada
2022-09-22 13:14:39 +02:00
committed by GitHub
parent 9393f966bc
commit 4d0f8c05f5
4 changed files with 12 additions and 7 deletions

View File

@@ -772,7 +772,6 @@ class CaptureStd:
```"""
def __init__(self, out=True, err=True, replay=True):
self.replay = replay
if out:
@@ -1122,7 +1121,6 @@ class TestCasePlus(unittest.TestCase):
tmp_dir(`string`): either the same value as passed via *tmp_dir* or the path to the auto-selected tmp dir
"""
if tmp_dir is not None:
# defining the most likely desired behavior for when a custom path is provided.
# this most likely indicates the debug mode where we want an easily locatable dir that:
# 1. gets cleared out before the test (if it already exists)
@@ -1200,7 +1198,6 @@ class TestCasePlus(unittest.TestCase):
return max_rss
def tearDown(self):
# get_auto_remove_tmp_dir feature: remove registered temp dirs
for path in self.teardown_tmp_dirs:
shutil.rmtree(path, ignore_errors=True)
@@ -1472,7 +1469,6 @@ async def _stream_subprocess(cmd, env=None, stdin=None, timeout=None, quiet=Fals
def execute_subprocess_async(cmd, env=None, stdin=None, timeout=180, quiet=False, echo=True) -> _RunOutput:
loop = asyncio.get_event_loop()
result = loop.run_until_complete(
_stream_subprocess(cmd, env=env, stdin=stdin, timeout=timeout, quiet=quiet, echo=echo)