Unverified Commit d7b20fe2 authored by Leo Gao's avatar Leo Gao Committed by GitHub
Browse files

naturalqs: update random

parent d42af30d
...@@ -33,7 +33,9 @@ class NaturalQs(HFTask): ...@@ -33,7 +33,9 @@ class NaturalQs(HFTask):
if self._training_docs is None: if self._training_docs is None:
self._training_docs = list(islice(self.training_docs(), 0, 100000)) self._training_docs = list(islice(self.training_docs(), 0, 100000))
return random.sample(self._training_docs, k) rnd = random.Random()
rnd.seed(42)
return rnd.sample(self._training_docs, k)
def doc_to_text(self, doc): def doc_to_text(self, doc):
return 'Q: ' + doc['question']['text'] + '\n\n' + 'A: ' return 'Q: ' + doc['question']['text'] + '\n\n' + 'A: '
......
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