Commit 10d4b64a authored by Leo Gao's avatar Leo Gao
Browse files

Minor WikiText fix

parent 5e31e40e
......@@ -65,7 +65,7 @@ class WikiText(PerplexityTask):
def docs_for_split(self, split):
ret = []
for line in open(f"data/wikitext/wikitext-2-raw/wiki.{split}.raw").read().split('\n'):
rline = line.replace("= =", "==").replace("= = =", "===").strip()
rline = line.replace("= = =", "===").replace("= =", "==").strip()
if rline.startswith('= ') and rline.strip().endswith(' ='):
s = '\n'.join(ret)
if s.strip(): yield s
......
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