aboutsummaryrefslogtreecommitdiff
path: root/train/src/ctak_train
diff options
context:
space:
mode:
Diffstat (limited to 'train/src/ctak_train')
-rw-r--r--train/src/ctak_train/data.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/train/src/ctak_train/data.py b/train/src/ctak_train/data.py
index 6dc9ec0..8d21bbe 100644
--- a/train/src/ctak_train/data.py
+++ b/train/src/ctak_train/data.py
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with ctak. If not, see <https://www.gnu.org/licenses/>.
-import json
+import orjson
from collections.abc import Iterator
from dataclasses import dataclass
from pathlib import Path
@@ -168,11 +168,11 @@ def load_window(
for file_index, path in enumerate(files):
is_newest = file_index == len(files) - 1
- with open(path) as f:
+ with open(path, "rb") as f:
for line in f:
if not line.strip():
continue
- game = json.loads(line)
+ game = orjson.loads(line)
game_result = float(game["result"])
self_play = int(game["cand_A"]) == int(game["cand_B"])
if is_newest: