Skip to content

Commit 1b9a703

Browse files
committed
fix: orjson writes binary, error is not an option
1 parent c70a45d commit 1b9a703

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import logging
21
from os.path import join as pjoin, abspath
32
import os
43

@@ -42,10 +41,11 @@ def _run(pure: bool):
4241

4342
def _eval(pure: bool):
4443
split = "pure" if pure else "base"
45-
logging.info(f"Running {model} on TF-Bench ({split}):")
44+
print(f"Running {model} on TF-Bench ({split}):")
4645
match _run(pure=False):
4746
case Success((mean, std)):
48-
logging.info(f"Accuracy: {mean:.4f} ± {std:.4f}")
47+
print(f"Accuracy: {mean:.4f} ± {std:.4f}")
48+
print("====================================")
4949
with open(log_file, "ab") as f:
5050
f.write(
5151
orjson.dumps(

src/tfbench/experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def run_one_model(
4545
case Success(r):
4646
gen_results.append(r)
4747
if output_file:
48-
with open(output_file, "ab", errors="ignore") as file:
48+
with open(output_file, "ab") as file:
4949
file.write(orjson.dumps(r, option=orjson.OPT_APPEND_NEWLINE))
5050
case Failure(e):
5151
logging.error(f"Error generating response: {e}")

0 commit comments

Comments
 (0)