Skip to content

Commit

Permalink
fix import error
Browse files Browse the repository at this point in the history
  • Loading branch information
congchan authored Nov 9, 2023
1 parent 7a83b50 commit b3c3d6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions data/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""data utils"""

import json

def read_text(path, debug=None):
" read in text data "
data = []
Expand All @@ -14,6 +16,7 @@ def read_text(path, debug=None):
data.append(line.strip())
return data


def read_json_line(file):
tmp_ls = open(file, 'r', encoding='utf-8').readlines()
tmp_ls = [json.loads(_.strip()) for _ in tmp_ls]
Expand Down
4 changes: 3 additions & 1 deletion rlhf/reward_modeling/rm_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import datasets
import logging
import numpy as np
import yaml

import datasets
import torch
from torch.utils.data import DataLoader
from torch import nn
Expand Down

0 comments on commit b3c3d6b

Please sign in to comment.