"vscode:/vscode.git/clone" did not exist on "ce96c3f67c87eb7c09464cf6cfebdebc47c655a6"
Commit 10d4b64a authored by Leo Gao's avatar Leo Gao
Browse files

Minor WikiText fix

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