Fix example logs repeating themselves (#16669)

Move declaration of log streams to before tests, so that results won't get compounded on top of each other
This commit is contained in:
Zachary Mueller
2022-04-11 16:25:16 -04:00
committed by GitHub
parent dce33f2150
commit 69233cf03b
5 changed files with 19 additions and 99 deletions

View File

@@ -40,14 +40,15 @@ def get_results(output_dir):
return results
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
@require_torch_tpu
class TorchXLAExamplesTests(TestCasePlus):
def test_run_glue(self):
import xla_spawn
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
tmp_dir = self.get_auto_remove_tmp_dir()
testargs = f"""
./examples/pytorch/text-classification/run_glue.py