Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
sagadre committed Dec 11, 2023
1 parent 946cf0c commit 1e704e9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions open_lm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from open_lm.logger import setup_logging
from open_lm.params import parse_args
from open_lm.scheduler import cosine_lr
from open_lm.train import train_one_epoch, evaluate
from open_lm.train import train_one_epoch, evaluate_loop
from open_lm.file_utils import (
pt_load,
check_exists,
Expand Down Expand Up @@ -636,8 +636,7 @@ def main(args):

if is_master(args):
with fsspec.open(os.path.join(checkpoint_root, "results.jsonl"), "a") as f:
f.write(json.dumps(metrics))
f.write("\n")
f.write(f"{json.dumps(metrics)}\n")

return

Expand Down Expand Up @@ -722,8 +721,7 @@ def main(args):

if is_master(args):
with fsspec.open(os.path.join(args.checkpoint_path, "results.jsonl"), "a") as f:
f.write(json.dumps(evaluation_metrics))
f.write("\n")
f.write(f"{json.dumps(evaluation_metrics)}\n")

except Exception as e:
if is_master(args):
Expand Down

0 comments on commit 1e704e9

Please sign in to comment.