Commit fe4a1efd authored by Leo Gao's avatar Leo Gao
Browse files

Fix linting problems

parent 7ab3f8ca
......@@ -20,4 +20,4 @@ class DummyLM(LM):
def greedy_until(self, requests):
# TODO: implement
pass
\ No newline at end of file
pass
......@@ -43,4 +43,4 @@ class GPT2LM(LM):
def greedy_until(self, requests):
# TODO: implement
pass
\ No newline at end of file
pass
......@@ -70,4 +70,4 @@ class ARCEasy(HFTask):
class ARCChallenge(ARCEasy):
DATASET_PATH = "ai2_arc"
DATASET_NAME = "ARC-Challenge"
\ No newline at end of file
DATASET_NAME = "ARC-Challenge"
......@@ -104,4 +104,4 @@ class DROP(Dataset):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -67,4 +67,4 @@ class LAMBADA(Dataset):
return {
'perplexity': False,
'accuracy': True
}
\ No newline at end of file
}
......@@ -87,4 +87,4 @@ class NaturalQs(HFTask):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -95,4 +95,4 @@ class OpenBookQA(HFTask):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -74,4 +74,4 @@ class PiQA(Dataset):
def higher_is_better(self):
return {
'acc': True
}
\ No newline at end of file
}
......@@ -103,4 +103,4 @@ class QuAC(Dataset):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -23,7 +23,8 @@ class RACE(HFTask):
return True
def _collate_data(self, set):
if set in self.cache: return self.cache[set]
if set in self.cache:
return self.cache[set]
# One big issue with HF's implementation of this dataset: it makes a
# separate document for each question; meanwhile, in the GPT3 paper it
# is shown that one document is made per passage.
......
......@@ -83,4 +83,4 @@ class SQuAD(HFTask):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -89,4 +89,4 @@ class StoryCloze(Dataset):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -74,4 +74,4 @@ class TriviaQA(Dataset):
def higher_is_better(self):
return {
"acc": True
}
\ No newline at end of file
}
......@@ -70,4 +70,4 @@ class WebQs(HFTask):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -121,4 +121,4 @@ class WikiText2(NLP_TASK):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -90,4 +90,4 @@ class Winogrande(HFTask):
whether a higher value of the submetric is better
"""
# TODO: implement evaluation.
raise NotImplementedError('Evaluation not implemented')
\ No newline at end of file
raise NotImplementedError('Evaluation not implemented')
......@@ -28,4 +28,4 @@ def simple_parse_args_string(args_string):
def join_iters(iters):
for iter in iters:
yield from iter
\ No newline at end of file
yield from iter
......@@ -5,11 +5,13 @@ from tqdm import tqdm
import json
class ExitCodeError(Exception): pass
class ExitCodeError(Exception):
pass
def sh(x):
if os.system(x): raise ExitCodeError()
if os.system(x):
raise ExitCodeError()
def ls(x):
return [x + '/' + fn for fn in os.listdir(x)]
......@@ -64,7 +66,8 @@ class join:
self.sep = sep
def __rrshift__(self, other):
if other is None: return
if other is None:
return
try:
return self.sep.join(other)
except:
......@@ -156,4 +159,4 @@ def comp(*fs):
return _f
X = Reflective()
\ No newline at end of file
X = Reflective()
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