OPUS-5.5-DATABASE / code /README.md
KeremTT's picture
Update code
73f7e6f verified
|
Raw History Blame Contribute Delete
2.98 kB
# 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
```