Download make_exact_171m_data.py from openmodelai/Terra-2.5: direct link, hf CLI and curl.
- Browser
- Download file 985 Bytes
-
https://huggingface.co/openmodelai/Terra-2.5/resolve/main/make_exact_171m_data.py
- Command line
-
hf download hf://openmodelai/Terra-2.5/make_exact_171m_data.py
-
curl -L -o make_exact_171m_data.py https://huggingface.co/openmodelai/Terra-2.5/resolve/main/make_exact_171m_data.py
985 Bytes
| """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() | |