File size: 985 Bytes
b838b2a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """Retain the trilingual QA data; update three answers to the exact 171M size."""
import json
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def main():
rows = [json.loads(s) for s in (ROOT/'data/71m/train.jsonl').read_text().splitlines()]
answers = {
'Сколько у тебя параметров сейчас?': 'В этой версии ровно 171 миллион параметров.',
'How many parameters do you have?': 'This version has exactly 171 million parameters.',
'你有多少参数?': '这个版本正好有 17100 万个参数。',
}
rows = [{**r, 'answer': answers.get(r['question'], r['answer'])} for r in rows]
dest = ROOT/'data/171m'
dest.mkdir(exist_ok=True)
(dest/'train.jsonl').write_text(''.join(json.dumps(r, ensure_ascii=False)+'\n' for r in rows), encoding='utf-8')
print(len(rows), 'examples; only 3 model-size answers changed')
if __name__ == '__main__':
main()
|