File size: 2,981 Bytes
c02657c 73f7e6f c02657c 73f7e6f c02657c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | # OPUS-5.5-DATABASE — build library
This folder contains the complete, reproducible pipeline behind the public Hugging Face dataset
**[KeremTT/OPUS-5.5-DATABASE](https://huggingface.co/datasets/KeremTT/OPUS-5.5-DATABASE)**: an open,
decontaminated, multi-stage training corpus for language models (pretraining text, SFT conversations,
preference pairs and a verifiable evaluation set) in English and Turkish.
The full dataset card — composition, charts, measured results and recipes per model size — is generated by
`scripts/make_card.py` and published on the Hub. The same code is mirrored in the dataset repository under `code/`.
> "OPUS-5.5" is only the project name. The dataset is not affiliated with or endorsed by Anthropic and contains no
> outputs of Anthropic's Claude models.
## Layout
| path | purpose |
|---|---|
| `opusdb/sources.py` | registry of upstream datasets: repo, exact files, verified license, row caps |
| `opusdb/synth.py` | OPUS-synth: verified EN/TR generators (word problems, algebra, number theory, dates, strings, logic, code with unit tests, JSON, unanswerable questions, units) |
| `opusdb/text.py` | normalisation, hashing, PII scrubbing, language heuristic, Gopher quality rules |
| `opusdb/dedup.py` | exact and MinHash-LSH near-duplicate removal |
| `opusdb/decontam.py` | 13-gram benchmark decontamination (GSM8K, MATH-500, HumanEval, MMLU) |
| `opusdb/synth_tools.py` | OPUS-synth-tools: verified tool-use conversations (EN/TR) |
| `opusdb/agent_tools.py` | tool runtime: calculator, python, date_calc, unit_convert + tool-call parser |
| `opusdb/tool_formats.py` | Hermes / ToolACE / Glaive converters; template-independent tool rendering |
| `opusdb/agent.py` | agent loop for running a fine-tuned model with the tools (and your own) |
| `scripts/download.py` | download upstream files |
| `scripts/build.py` | build all configs as Parquet + statistics |
| `scripts/charts.py` | render the dataset-card figures |
| `scripts/make_card.py` | render the dataset card |
| `scripts/upload.py` | publish data, figures, card and code to the Hub |
| `train/sft_trl.py`, `train/dpo_trl.py` | SFT (`--with-tools`) / DPO with TRL (full or LoRA) |
| `train/recipe_4b.sh` | end-to-end recipe for a ~4B model: SFT + tools → DPO → eval |
| `train/eval_tools.py` | agent-loop evaluation on the `tools` test split |
| `train/eval_synth.py` | exact-match evaluation on `synth_eval` |
| `train/small_sft.py`, `train/scaling_ladder.py` | the small measured experiments reported in the card |
| `tests/` | unit tests for the library |
## Reproduce
```bash
pip install -r requirements.txt
export OPUSDB_RAW=raw OPUSDB_OUT=out
python scripts/download.py
python scripts/build.py
python train/scaling_ladder.py --data out/data/pretrain --out out/stats/ladder.json
python scripts/charts.py
python scripts/make_card.py
python scripts/upload.py # needs a Hugging Face token with write access
```
```bash
python -m unittest discover -s tests -v
```
|