Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
5
20
transformers>=4.40.0
trl>=0.8.0
peft>=0.11.0
bitsandbytes>=0.43.0
accelerate>=0.30.0
datasets>=2.19.0
pyyaml>=6.0
sentencepiece
protobuf
huggingface-hub
llama-cpp-python
numpy
scikit-learn

mumble-cleanup training data + code

Reproducibility release for the 2-stage LoRA fine-tune of Qwen/Qwen2.5-0.5B-Instruct that produces the Echo Flow AI transcript-cleanup model. The trained GGUF is published separately at amitashwini/mumble-cleanup-2stage.

What's in this repo

  • data/synthetic/corpus_50k.jsonl — 50,000 synthetic (raw, clean) transcript pairs from the Echo Flow combinatorial template generator. Each line is a chat-template JSON object: {"messages": [{"role":"system",...}, {"role":"user",...}, {"role":"assistant",...}]}.
  • scripts/ — 14 Python scripts: synthetic data generation, MLX training, evaluation, GGUF conversion, and HF upload. See "Pipeline" below.
  • configs/ — LoRA training configurations for Hugging Face trl/PEFT.
  • requirements-train.txt — Python dependencies for the training pipeline.

Pipeline

1.  Generate synthetic  → scripts/generate_synthetic_corpus.py
2.  (optional) domain    → scripts/generate_domain_examples.py
3.  Prepare MLX data     → scripts/prepare_mlx_data.py + scripts/prepare_stage2_data.py
4.  Stage 1: pretrain    → scripts/train_2stage.py (LoRA on 50k synthetic, lr=2e-4)
5.  Stage 2: fine-tune   → scripts/train_2stage.py (resume adapter, lr=2e-5 on 688 real)
6.  Convert to GGUF      → scripts/convert_to_gguf.py (or llama.cpp convert_hf_to_gguf.py + llama-quantize)
7.  Evaluate             → scripts/compare_models.py
8.  Upload to HF         → scripts/upload_to_hf.py

Reproducing the 2-stage model

Hardware

Trained on an Apple M4 (16 GB RAM, macOS 26+). The same script works on a CUDA GPU by editing MLX_CONFIG/device flags in train_2stage.py; for CUDA you would use the Hugging Face trl path in train_lora.py instead of mlx_lm.lora.

Environment

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-train.txt

Build llama.cpp tools (for GGUF conversion)

cd ../EchoFlow/Vendor/llama.cpp  # or your llama.cpp checkout
cmake -S . -B build-tools -DLLAMA_BUILD_TOOLS=ON -DGGML_METAL=ON
cmake --build build-tools --target llama-quantize -j8

Run the full pipeline

# 1. Generate synthetic data (already in this repo at data/synthetic/corpus_50k.jsonl)
python scripts/generate_synthetic_corpus.py \
    --output data/synthetic/corpus_50k.jsonl --count 50000 --seed 2026

# 2. Prepare MLX chat-format datasets
python scripts/prepare_mlx_data.py \
    --input data/synthetic/corpus_50k.jsonl \
    --output data/mlx_dataset --valid-count 200
python scripts/prepare_stage2_data.py \
    --output data/mlx_dataset_688 --valid-count 50

# 3. 2-stage LoRA training
python scripts/train_2stage.py

# 4. Fuse + convert to GGUF Q4_K_M
python ../EchoFlow/Vendor/llama.cpp/convert_hf_to_gguf.py \
    data/models/mumble-cleanup-2stage/fused \
    --outfile data/models/mumble-cleanup-2stage-f16.gguf
../EchoFlow/Vendor/llama.cpp/build-tools/bin/llama-quantize \
    data/models/mumble-cleanup-2stage-f16.gguf \
    data/models/mumble-cleanup-2stage-q4km.gguf Q4_K_M

# 5. Evaluate
python scripts/compare_models.py \
    --baseline path/to/original/mumble-cleanup-q4km.gguf \
    --candidate data/models/mumble-cleanup-2stage-q4km.gguf \
    --corpus ../EchoFlow/Tests/EchoFlowUIReviewTests/Fixtures/DictationQuality

Expected result: 10/10 pass rate on the golden corpus, SHA-256 fc6409457b8db4b37ef6184ae720a9bffe4df5ac506979ed83d0d53faab158ab, file size 397,807,904 bytes.

Real 688-pair fine-tune data

The stage-2 fine-tune uses adikuma/mumble-cleanup-dataset (688 hand-curated (raw, clean) pairs) — that is not included in this repo to keep the release focused on the data Echo Flow contributed. It is loaded at runtime via:

from datasets import load_dataset
ds = load_dataset("adikuma/mumble-cleanup-dataset")

License

Apache-2.0. The base Qwen2.5-0.5B-Instruct model and the real fine-tune data are both Apache-2.0.

Citation

If you use this data or training pipeline, please cite:

@software{echo_flow_ai_2stage,
  title  = {Echo Flow AI: 2-stage LoRA fine-tune for speech-to-text cleanup},
  author = {Echo Flow},
  year   = {2026},
  url    = {https://huggingface.co/amitashwini/mumble-cleanup-2stage}
}
Downloads last month
22