Commit 38e8858f authored by Leo Gao's avatar Leo Gao
Browse files

Get rid of utils_stream

parent 88ec855d
......@@ -3,7 +3,19 @@ import datasets
import numpy as np
from lm_eval.base import rf, mean
from . common import HFTask
from ..utils_stream import each
import os
from functools import reduce
import operator
from tqdm import tqdm
import json
class each:
def __init__(self, f):
self.f = f
def __rrshift__(self, other):
return list(map(self.f, other))
class RACE(HFTask):
......
import os
from functools import reduce
import operator
from tqdm import tqdm
import json
# TODO: phase out utils_stream
class each:
def __init__(self, f):
self.f = f
def __rrshift__(self, other):
return list(map(self.f, other))
class filt:
def __init__(self, f):
self.f = f
def __rrshift__(self, other):
return list(filter(self.f, other))
class apply:
def __init__(self, f):
self.f = f
def __rrshift__(self, other):
return self.f(other)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment