Skip to content

Commit

Permalink
Merge pull request #248 from EleutherAI/Tee-patch
Browse files Browse the repository at this point in the history
Update logging.py
  • Loading branch information
StellaAthena committed Apr 25, 2021
2 parents f90e083 + 4ec6c3f commit 3778af3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions megatron/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ def __del__(self):
self.file.close()

def write(self, data):
self.file.write(data)
self.std.write(data)
try:
self.file.write(data)
except OSError:
pass
try:
self.std.write(data)
except OSError:
pass

def flush(self):
self.file.flush()
try:
self.file.flush()
except OSError:
pass

0 comments on commit 3778af3

Please sign in to comment.