Download make_exact_26m_data.py from openmodelai/Terra-2.5: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/openmodelai/Terra-2.5/resolve/main/make_exact_26m_data.py
- Command line
-
hf download hf://openmodelai/Terra-2.5/make_exact_26m_data.py
-
curl -L -o make_exact_26m_data.py https://huggingface.co/openmodelai/Terra-2.5/resolve/main/make_exact_26m_data.py
1 kB
| """Keep the existing RU/EN/ZH dataset; update the three model-size answers.""" | |
| import json | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def main(): | |
| rows = [json.loads(s) for s in (ROOT/'data/multilingual/train.jsonl').read_text().splitlines()] | |
| answers = { | |
| 'Сколько у тебя параметров сейчас?': 'В этой версии ровно 26 миллионов параметров.', | |
| 'How many parameters do you have?': 'This version has exactly 26 million parameters.', | |
| '你有多少参数?': '这个版本正好有 2600 万个参数。', | |
| } | |
| rows = [{**r, 'answer': answers.get(r['question'], r['answer'])} for r in rows] | |
| dest = ROOT/'data/26m' | |
| 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 the 3 parameter-count answers changed') | |
| if __name__ == '__main__': | |
| main() | |