Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,24 @@ tools/check_workflows.py the check CI runs on every workflow
| [dataset-statistics](workflows/dataset-statistics) | Profiles, filters, deduplicates and re-packs a Parquet dataset | none |
| [embed-dataset](workflows/embed-dataset) | Embeds every row with Text Embeddings Inference and parallel clients | TEI |
| [retrieval-index](workflows/retrieval-index) | Builds a RAG index from PDFs and answers a test query | TEI |
| [semantic-dedup](workflows/semantic-dedup) | Drops rows that mean nearly the same | vLLM batch |
| [semantic-deduplication](workflows/semantic-deduplication) | Drops rows that mean nearly the same | vLLM batch |
| [entity-extraction](workflows/entity-extraction) | Extracts named entities of types you name with GLiNER | none |
| [web-text-curation](workflows/web-text-curation) | Filters and deduplicates web text with datatrove | none |

### Training and aligning language models

| Workflow | What it does | GPU steps |
|----------|--------------|-----------|
| [finetune-evaluate-quantize](workflows/finetune-evaluate-quantize) | Fine-tunes, evaluates, converts to GGUF, quantizes and publishes | TRL SFT, lm-eval |
| [compare-finetunes](workflows/compare-finetunes) | Fine-tunes twice with different settings and compares scores | TRL SFT, lm-eval |
| [fine-tune-evaluate-quantize](workflows/fine-tune-evaluate-quantize) | Fine-tunes, evaluates, converts to GGUF, quantizes and publishes | TRL SFT, lm-eval |
| [compare-fine-tunes](workflows/compare-fine-tunes) | Fine-tunes twice with different settings and compares scores | TRL SFT, lm-eval |
| [train-then-serve](workflows/train-then-serve) | Fine-tunes a model and serves it with vLLM in the same run | TRL SFT, vLLM |
| [dpo-alignment](workflows/dpo-alignment) | Aligns a model with DPO and measures its win rate with a judge | TRL DPO, vLLM batch |
| [kto-alignment](workflows/kto-alignment) | Aligns a model with KTO and measures its win rate with a judge | TRL KTO, vLLM batch |
| [reward-model](workflows/reward-model) | Trains a reward model and scores held-out preference pairs | TRL reward |
| [grpo-math](workflows/grpo-math) | Trains math reasoning with GRPO and a checked reward | TRL GRPO, lm-eval |
| [rloo-math](workflows/rloo-math) | Trains math reasoning with RLOO and a checked reward | TRL RLOO, lm-eval |
| [distill-model](workflows/distill-model) | Distills a larger model into a smaller one | TRL distillation, lm-eval |
| [vlm-finetune](workflows/vlm-finetune) | Fine-tunes a vision-language model and compares accuracy | TRL SFT, vLLM batch |
| [fine-tune-vision-language-model](workflows/fine-tune-vision-language-model) | Fine-tunes a vision-language model and compares accuracy | TRL SFT, vLLM batch |

### Merging, quantizing and serving

Expand All @@ -110,15 +110,15 @@ tools/check_workflows.py the check CI runs on every workflow
| [text-classification](workflows/text-classification) | Fine-tunes an encoder to classify text | training, prediction |
| [text-regression](workflows/text-regression) | Fine-tunes an encoder to predict a number per text | training, prediction |
| [token-classification](workflows/token-classification) | Fine-tunes an encoder to tag named entities | training, tagging |
| [extractive-qa](workflows/extractive-qa) | Fine-tunes a model to find answers in long documents | training, scoring tokens |
| [extractive-question-answering](workflows/extractive-question-answering) | Fine-tunes a model to find answers in long documents | training, scoring tokens |
| [summarization](workflows/summarization) | Fine-tunes a sequence-to-sequence model to summarize | training, generation |
| [translation](workflows/translation) | Fine-tunes a translation model | training, generation |
| [sentence-embeddings](workflows/sentence-embeddings) | Fine-tunes a sentence-embedding model for retrieval | training, embedding |
| [setfit-classifier](workflows/setfit-classifier) | Trains a few-shot classifier with SetFit | training, prediction |
| [image-classification](workflows/image-classification) | Fine-tunes a vision transformer to classify images | training, prediction |
| [image-regression](workflows/image-regression) | Fine-tunes a vision transformer to predict a number per image | training, prediction |
| [object-detection](workflows/object-detection) | Fine-tunes an object detector and scores its mAP | training, detection |
| [tabular](workflows/tabular) | Trains gradient-boosted trees on a table | none |
| [tabular-gradient-boosting](workflows/tabular-gradient-boosting) | Trains gradient-boosted trees on a table | none |

Each workflow's README lists its steps, says which part stays one script and
why, and gives the licenses of its default model, data and the packages its
Expand Down
2 changes: 1 addition & 1 deletion requirements/cpu-chat-images.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# What vlm-finetune's step that writes chat rows installs into the python-3-13 task.
# What fine-tune-vision-language-model's step that writes chat rows installs into the python-3-13 task.
datasets==5.2.0
huggingface_hub==2.5.0
pillow==13.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ blocks:
examples = f"{storage}/examples"
subprocess.run([sys.executable, "-m", "pip", "install", "--quiet", "--target", "/tmp/deps",
"-r", f"{examples}/requirements/cpu-tokenize.txt"], check=True)
subprocess.run([sys.executable, f"{examples}/workflows/extractive-qa/preprocess.py",
subprocess.run([sys.executable, f"{examples}/workflows/extractive-question-answering/preprocess.py",
"--model", f"{storage}/base-model",
"--train", f"{storage}/train.parquet", "--eval", f"{storage}/eval.parquet",
"--output", f"{storage}/tokenized"],
Expand All @@ -95,7 +95,7 @@ blocks:
import os, subprocess, sys

storage = os.environ["WORKFLOW_STORAGE"]
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-qa/train.py",
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-question-answering/train.py",
"--model", f"{storage}/base-model", "--data", f"{storage}/tokenized",
"--epochs", "${{inputs.epochs}}", "--output", f"{storage}/model"], check=True)

Expand All @@ -110,7 +110,7 @@ blocks:
import os, subprocess, sys

storage = os.environ["WORKFLOW_STORAGE"]
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-qa/predict.py",
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-question-answering/predict.py",
"--model", f"{storage}/model", "--data", f"{storage}/tokenized/eval",
"--output", f"{storage}/window-scores.jsonl"], check=True)

Expand All @@ -124,7 +124,7 @@ blocks:
import os, subprocess, sys

storage = os.environ["WORKFLOW_STORAGE"]
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-qa/postprocess.py",
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-question-answering/postprocess.py",
"--scores", f"{storage}/window-scores.jsonl",
"--examples", f"{storage}/eval-examples.jsonl",
"--output", f"{storage}/answers.jsonl"], check=True)
Expand All @@ -139,7 +139,7 @@ blocks:
import os, subprocess, sys

storage = os.environ["WORKFLOW_STORAGE"]
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-qa/score.py",
subprocess.run([sys.executable, f"{storage}/examples/workflows/extractive-question-answering/score.py",
"--answers", f"{storage}/answers.jsonl", "--output", f"{storage}/metrics.json"], check=True)

publish:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ blocks:
examples = f"{storage}/examples"
subprocess.run([sys.executable, "-m", "pip", "install", "--quiet", "--target", "/tmp/deps",
"-r", f"{examples}/requirements/cpu-chat-images.txt"], check=True)
subprocess.run([sys.executable, f"{examples}/workflows/vlm-finetune/prepare.py",
subprocess.run([sys.executable, f"{examples}/workflows/fine-tune-vision-language-model/prepare.py",
"--data", f"{storage}/train-images.parquet", "--labels", "${{inputs.labels}}",
"--question", """${{inputs.question}}""", "--output", f"{storage}/train-chat.parquet"],
env={**os.environ, "PYTHONPATH": "/tmp/deps"}, check=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ blocks:
examples = f"{storage}/examples"
subprocess.run([sys.executable, "-m", "pip", "install", "--quiet", "--target", "/tmp/deps",
"-r", f"{examples}/requirements/cpu-numpy.txt"], check=True)
subprocess.run([sys.executable, f"{examples}/workflows/semantic-dedup/similar_pairs.py",
subprocess.run([sys.executable, f"{examples}/workflows/semantic-deduplication/similar_pairs.py",
"--embeddings", f"{storage}/vectors.parquet", "--threshold", "${{inputs.threshold}}",
"--pairs", f"{storage}/pairs.parquet", "--drop", f"{storage}/drop.parquet"],
env={**os.environ, "PYTHONPATH": "/tmp/deps"}, check=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ blocks:
os.makedirs(f"{storage}/model", exist_ok=True)
subprocess.run([sys.executable, "-m", "pip", "install", "--quiet", "--target", "/tmp/deps",
"-r", f"{examples}/requirements/cpu-tabular.txt"], check=True)
subprocess.run([sys.executable, f"{examples}/workflows/tabular/train.py",
subprocess.run([sys.executable, f"{examples}/workflows/tabular-gradient-boosting/train.py",
"--train", f"{storage}/train.parquet", "--target", "${{inputs.target}}",
"--task", "${{inputs.task}}", "--output", f"{storage}/model"],
env={**os.environ, "PYTHONPATH": "/tmp/deps"}, check=True)
Expand All @@ -85,7 +85,7 @@ blocks:
examples = f"{storage}/examples"
subprocess.run([sys.executable, "-m", "pip", "install", "--quiet", "--target", "/tmp/deps",
"-r", f"{examples}/requirements/cpu-tabular.txt"], check=True)
subprocess.run([sys.executable, f"{examples}/workflows/tabular/evaluate.py",
subprocess.run([sys.executable, f"{examples}/workflows/tabular-gradient-boosting/evaluate.py",
"--model", f"{storage}/model", "--test", f"{storage}/test.parquet",
"--output", f"{storage}/metrics.json", "--predictions", f"{storage}/predictions.parquet"],
env={**os.environ, "PYTHONPATH": "/tmp/deps"}, check=True)
Expand Down
Loading