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

Fix linting problems

parent 7ab3f8ca
...@@ -23,7 +23,8 @@ class RACE(HFTask): ...@@ -23,7 +23,8 @@ class RACE(HFTask):
return True return True
def _collate_data(self, set): 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 # One big issue with HF's implementation of this dataset: it makes a
# separate document for each question; meanwhile, in the GPT3 paper it # separate document for each question; meanwhile, in the GPT3 paper it
# is shown that one document is made per passage. # is shown that one document is made per passage.
......
...@@ -5,11 +5,13 @@ from tqdm import tqdm ...@@ -5,11 +5,13 @@ from tqdm import tqdm
import json import json
class ExitCodeError(Exception): pass class ExitCodeError(Exception):
pass
def sh(x): def sh(x):
if os.system(x): raise ExitCodeError() if os.system(x):
raise ExitCodeError()
def ls(x): def ls(x):
return [x + '/' + fn for fn in os.listdir(x)] return [x + '/' + fn for fn in os.listdir(x)]
...@@ -64,7 +66,8 @@ class join: ...@@ -64,7 +66,8 @@ class join:
self.sep = sep self.sep = sep
def __rrshift__(self, other): def __rrshift__(self, other):
if other is None: return if other is None:
return
try: try:
return self.sep.join(other) return self.sep.join(other)
except: except:
......
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