diff --git a/tools/check_workflows.py b/tools/check_workflows.py index c1b77cc..17c87a8 100644 --- a/tools/check_workflows.py +++ b/tools/check_workflows.py @@ -3,7 +3,8 @@ python tools/check_workflows.py --catalog For each workflows//workflow.yaml it checks that the file parses, uses only -the keys the workflow syntax allows, names compute types Swale offers, and that +the keys the workflow syntax allows, has a description of at most 160 characters, +names compute types Swale offers, and that every task names a catalog definition without a version, passes only inputs that definition declares and every input it requires, and runs a definition that needs a GPU on a GPU compute type and a CPU definition on a CPU one. Every Python script @@ -47,6 +48,9 @@ def check_workflow(path, catalog): errors.append(f"unknown top-level keys {sorted(unknown)}") if not NAME_RE.match(str(wf.get("name", ""))): errors.append(f"name {wf.get('name')!r} must be 1-100 letters, numbers, spaces, '.', '_' or '-'") + description = str(wf.get("description") or "") + if not 1 <= len(description) <= 160: + errors.append(f"description is {len(description)} characters; it must be 1-160") default_compute = wf.get("compute_type") if default_compute not in COMPUTE_TYPES: errors.append(f"compute_type {default_compute!r} is not one Swale offers") diff --git a/workflows/caption-video/README.md b/workflows/caption-video/README.md index e6b32fc..c74340e 100644 --- a/workflows/caption-video/README.md +++ b/workflows/caption-video/README.md @@ -23,7 +23,7 @@ Every step is its own task. |-------|---------|-------------| | `video_url` | the Sintel trailer | URL or workspace path of the video; anything FFmpeg reads. | | `seconds_per_frame` | `4` | Seconds between captioned frames. | -| `model` | `Qwen/Qwen2-VL-2B-Instruct` | Vision-language model on the Hub. | +| `model` | `Qwen/Qwen2-VL-2B-Instruct` | Vision-language model on the Hugging Face Hub. | The download reads the secret `hf_token`. diff --git a/workflows/caption-video/workflow.yaml b/workflows/caption-video/workflow.yaml index 16de87a..716ccc7 100644 --- a/workflows/caption-video/workflow.yaml +++ b/workflows/caption-video/workflow.yaml @@ -10,7 +10,7 @@ inputs: description: Seconds between the frames that are captioned. default: "4" model: - description: Hub repo id of the vision-language model that captions. + description: Hugging Face repo id of the vision-language model that captions. default: Qwen/Qwen2-VL-2B-Instruct entry_point: main diff --git a/workflows/classify-images/README.md b/workflows/classify-images/README.md index 15e19d5..f281ea3 100644 --- a/workflows/classify-images/README.md +++ b/workflows/classify-images/README.md @@ -13,7 +13,7 @@ labels, a last step measures agreement and prints a confusion table. | Label | `swaleio/vllm-batch` | `a100-1` | | Join labels to the images' other columns, count each label, write Parquet | `swaleio/duckdb` | `cpu-4` | | Measure agreement with existing labels, when `gold_column` is set | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task; only labelling holds a GPU. @@ -25,7 +25,7 @@ model, or fine-tune one with the | Input | Default | Description | |-------|---------|-------------| -| `model` | `Qwen/Qwen2-VL-2B-Instruct` | Vision-language model on the Hub that vLLM serves. | +| `model` | `Qwen/Qwen2-VL-2B-Instruct` | Vision-language model on the Hugging Face Hub that vLLM serves. | | `images` | the test split of `AI-Lab-Makerere/beans` | Parquet file or glob with a Hugging Face Image column, as a DuckDB path. | | `image_column` | `image` | The Image column: a struct whose `bytes` field holds the encoded image. | | `image_type` | `image/jpeg` | Media type of the encoded images. | @@ -33,7 +33,7 @@ model, or fine-tune one with the | `instruction` | a question about bean leaves | What the model is asked about each image. | | `gold_column` | `labels` | Column of existing labels, as positions in `labels` from 0; empty skips the comparison. | | `limit` | `1000` | Number of images to label. | -| `hub_repo` | empty | Hub dataset repo to upload `labels.parquet` to. | +| `hub_repo` | empty | Hugging Face dataset repo to upload `labels.parquet` to. | The model download and the upload read the secret `hf_token`. diff --git a/workflows/classify-images/workflow.yaml b/workflows/classify-images/workflow.yaml index b94fba2..62d920f 100644 --- a/workflows/classify-images/workflow.yaml +++ b/workflows/classify-images/workflow.yaml @@ -1,10 +1,10 @@ name: Classify images with a vision-language model -description: Labels every image in a dataset with one of a fixed set of labels, using a vision-language model through vLLM batch inference, and measures agreement with existing labels. +description: Labels each image with one of a fixed set of labels, using a vision-language model through vLLM batch inference, and measures agreement with existing labels. compute_type: cpu-4 inputs: model: - description: Hub repo id of the vision-language model that labels. + description: Hugging Face repo id of the vision-language model that labels. default: Qwen/Qwen2-VL-2B-Instruct images: description: Parquet file or glob holding the images in a Hugging Face Image column, as a DuckDB path such as hf://datasets///. @@ -28,7 +28,7 @@ inputs: description: Number of images to label. default: "1000" hub_repo: - description: Hub dataset repo to upload the labels to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the labels to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -131,7 +131,7 @@ blocks: upload: tasks: upload_labels: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/compare-finetunes/README.md b/workflows/compare-finetunes/README.md index bd3a2c3..ecf9164 100644 --- a/workflows/compare-finetunes/README.md +++ b/workflows/compare-finetunes/README.md @@ -19,7 +19,7 @@ Every step is its own task. The two branches hold a GPU each while they run. | Input | Default | Description | |-------|---------|-------------| | `model` | `Qwen/Qwen2.5-0.5B-Instruct` | Model to fine-tune. | -| `dataset` | `HuggingFaceH4/ultrafeedback_binarized` | Hub dataset with a `messages` column. | +| `dataset` | `HuggingFaceH4/ultrafeedback_binarized` | Hugging Face dataset with a `messages` column. | | `split` | `train_sft[:5000]` | Split, or slice of one, to train on. | | `learning_rate_a` | `1.0e-5` | Learning rate of fine-tune A. | | `learning_rate_b` | `5.0e-5` | Learning rate of fine-tune B. | diff --git a/workflows/compare-finetunes/workflow.yaml b/workflows/compare-finetunes/workflow.yaml index 85de1a5..81bbc6f 100644 --- a/workflows/compare-finetunes/workflow.yaml +++ b/workflows/compare-finetunes/workflow.yaml @@ -4,10 +4,10 @@ compute_type: cpu-4 inputs: model: - description: Hub repo id of the model to fine-tune. + description: Hugging Face repo id of the model to fine-tune. default: Qwen/Qwen2.5-0.5B-Instruct dataset: - description: Hub dataset with a messages column of chat turns. + description: Hugging Face dataset with a messages column of chat turns. default: HuggingFaceH4/ultrafeedback_binarized split: description: Split of the dataset to train on. diff --git a/workflows/dataset-statistics/README.md b/workflows/dataset-statistics/README.md index d156b09..c8aebc7 100644 --- a/workflows/dataset-statistics/README.md +++ b/workflows/dataset-statistics/README.md @@ -23,7 +23,7 @@ Every step is its own task. | `min_chars` | `20` | Shortest text kept. | | `max_chars` | `4000` | Longest text kept. | | `rows_per_file` | `20000` | Rows per output file, roughly. | -| `hub_repo` | empty | Hub dataset repo to upload the files to, under `data/`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the files to, under `data/`. | The upload reads the secret `hf_token`. For datasets of tens of gigabytes, give the tasks `cpu-16`. diff --git a/workflows/dataset-statistics/workflow.yaml b/workflows/dataset-statistics/workflow.yaml index b2da929..72d6734 100644 --- a/workflows/dataset-statistics/workflow.yaml +++ b/workflows/dataset-statistics/workflow.yaml @@ -19,7 +19,7 @@ inputs: description: Rows in each output Parquet file, roughly. default: "20000" hub_repo: - description: Hub dataset repo to upload the files to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the files to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -78,7 +78,7 @@ blocks: upload: tasks: upload_files: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/detect-objects/workflow.yaml b/workflows/detect-objects/workflow.yaml index 023a04d..2343313 100644 --- a/workflows/detect-objects/workflow.yaml +++ b/workflows/detect-objects/workflow.yaml @@ -1,10 +1,10 @@ name: Detect objects with a vision-language model -description: Asks a vision-language model for the bounding boxes of chosen objects in every image, compares the counts with existing annotations, and draws the boxes on sample images. +description: Asks a vision-language model for the bounding boxes of chosen objects in every image, compares the counts with annotations, and draws boxes on samples. compute_type: cpu-4 inputs: model: - description: Hub repo id of a vision-language model that answers with bounding boxes as JSON. + description: Hugging Face repo id of a vision-language model that answers with bounding boxes as JSON. default: Qwen/Qwen3-VL-2B-Instruct images: description: Parquet file or glob with a Hugging Face Image column, as a DuckDB path. diff --git a/workflows/distill-model/README.md b/workflows/distill-model/README.md index 40fdfda..06b2381 100644 --- a/workflows/distill-model/README.md +++ b/workflows/distill-model/README.md @@ -24,7 +24,7 @@ trains. | `student` | `Qwen/Qwen2.5-0.5B-Instruct` | Student model; all of its weights are trained. | | `teacher` | `Qwen/Qwen2.5-1.5B-Instruct` | Teacher model; it must share the student's vocabulary. | | `train_prompts` | `4000` | GSM8K training questions to distill on. | -| `hub_repo` | empty | Hub model repo to upload the student to. | +| `hub_repo` | empty | Hugging Face model repo to upload the student to. | Training, the first evaluation and the upload read the secret `hf_token`. diff --git a/workflows/distill-model/workflow.yaml b/workflows/distill-model/workflow.yaml index 5e3f0b1..b00c169 100644 --- a/workflows/distill-model/workflow.yaml +++ b/workflows/distill-model/workflow.yaml @@ -4,16 +4,16 @@ compute_type: cpu-4 inputs: student: - description: Hub repo id of the student model. All of its weights are trained. + description: Hugging Face repo id of the student model. All of its weights are trained. default: Qwen/Qwen2.5-0.5B-Instruct teacher: - description: Hub repo id of the teacher model; it must share the student's vocabulary. + description: Hugging Face repo id of the teacher model; it must share the student's vocabulary. default: Qwen/Qwen2.5-1.5B-Instruct train_prompts: description: Number of GSM8K training questions to distill on. default: "4000" hub_repo: - description: Hub model repo to upload the distilled student to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the distilled student to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -114,7 +114,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/dpo-alignment/README.md b/workflows/dpo-alignment/README.md index e660588..c2f4932 100644 --- a/workflows/dpo-alignment/README.md +++ b/workflows/dpo-alignment/README.md @@ -33,7 +33,7 @@ it is. A 0.5B model trains on one A100 this way; for larger models, add | `judge` | `Qwen/Qwen3-8B` | Judge model. | | `train_split` | `train_prefs[:10000]` | Pairs of `HuggingFaceH4/ultrafeedback_binarized` to train on. | | `eval_prompts` | `200` | Held-out prompts, from its `test_prefs` split. | -| `hub_repo` | empty | Hub model repo to upload the aligned model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the aligned model to. | The downloads, the training and the upload read the secret `hf_token`. diff --git a/workflows/dpo-alignment/workflow.yaml b/workflows/dpo-alignment/workflow.yaml index 76ae940..32d7706 100644 --- a/workflows/dpo-alignment/workflow.yaml +++ b/workflows/dpo-alignment/workflow.yaml @@ -1,13 +1,13 @@ name: Align a model with DPO -description: Aligns a chat model to preference pairs with TRL's DPO, then has a judge model compare its answers with the base model's on held-out prompts and reports the win rate. +description: Aligns a chat model to preference pairs with TRL's DPO, then measures its win rate against the base model on held-out prompts with a judge model. compute_type: cpu-4 inputs: model: - description: Hub repo id of the chat model to align. All of its weights are trained. + description: Hugging Face repo id of the chat model to align. All of its weights are trained. default: Qwen/Qwen2.5-0.5B-Instruct judge: - description: Hub repo id of the judge model. + description: Hugging Face repo id of the judge model. default: Qwen/Qwen3-8B train_split: description: Preference pairs to train on, from HuggingFaceH4/ultrafeedback_binarized. @@ -16,7 +16,7 @@ inputs: description: Number of held-out prompts the two models answer for the judge. default: "200" hub_repo: - description: Hub model repo to upload the aligned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the aligned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -191,7 +191,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/embed-dataset/README.md b/workflows/embed-dataset/README.md index a674a82..e1ca5ed 100644 --- a/workflows/embed-dataset/README.md +++ b/workflows/embed-dataset/README.md @@ -13,7 +13,7 @@ When the clients are done, the platform stops the server. | Wait for the server, checking every 5 seconds | `swaleio/http-request` | `cpu-4` | | For each shard: embed its rows, 32 per request | `swaleio/python-3-13` | `cpu-4` | | Gather the vectors into `embeddings.parquet` | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task. Each client is a short Python script that uses only the standard library. @@ -26,11 +26,11 @@ reranker architectures and is built for this one job. | Input | Default | Description | |-------|---------|-------------| -| `model` | `BAAI/bge-small-en-v1.5` | Embedding model on the Hub. | +| `model` | `BAAI/bge-small-en-v1.5` | Embedding model on the Hugging Face Hub. | | `dataset` | the train split of `openai/gsm8k` | Parquet file or glob, as a DuckDB path. | | `text_column` | `question` | Column to embed. | | `shards` | `["0", "1", "2", "3"]` | One client task per element. | -| `hub_repo` | empty | Hub dataset repo to upload the embeddings to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the embeddings to, as `data/train.parquet`. | The upload reads the secret `hf_token`. diff --git a/workflows/embed-dataset/workflow.yaml b/workflows/embed-dataset/workflow.yaml index 79459d9..bc366b1 100644 --- a/workflows/embed-dataset/workflow.yaml +++ b/workflows/embed-dataset/workflow.yaml @@ -1,10 +1,10 @@ name: Embed a dataset -description: Serves an embedding model with Text Embeddings Inference and embeds every row of a dataset with several client tasks in parallel, one per shard, into one Parquet file. +description: Serves an embedding model with Text Embeddings Inference and embeds every row of a dataset into one Parquet file, with one client task per shard in parallel. compute_type: cpu-4 inputs: model: - description: Hub repo id of an embedding model Text Embeddings Inference serves. + description: Hugging Face repo id of an embedding model Text Embeddings Inference serves. default: BAAI/bge-small-en-v1.5 dataset: description: Parquet file or glob, as a DuckDB path. @@ -16,7 +16,7 @@ inputs: description: The client shards, as a JSON array; one client task runs per element, and each embeds every nth row. default: '["0", "1", "2", "3"]' hub_repo: - description: Hub dataset repo to upload the embeddings to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the embeddings to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -125,7 +125,7 @@ blocks: upload: tasks: upload_embeddings: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/entity-extraction/README.md b/workflows/entity-extraction/README.md index ba1ff5a..e301415 100644 --- a/workflows/entity-extraction/README.md +++ b/workflows/entity-extraction/README.md @@ -1,4 +1,4 @@ -# Entity extraction with GLiNER +# Extract named entities with GLiNER Finds named entities of the types you name, such as people, organisations, places and dates, in a collection of texts, with GLiNER. GLiNER takes the types @@ -14,7 +14,7 @@ they found. | Number the texts and cut each to `max_characters` | `swaleio/duckdb` | `cpu-4` | | For each shard: extract the entities ([`extract.py`](extract.py)) | `swaleio/python-3-13` | `cpu-4` each | | Count mentions per type and list the most frequent entities | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | **What stays one script:** the extraction pass over a shard, one model call per text. @@ -35,7 +35,7 @@ installs. | Input | Default | Description | |-------|---------|-------------| -| `model` | `urchade/gliner_small-v2.1` | GLiNER model on the Hub. | +| `model` | `urchade/gliner_small-v2.1` | GLiNER model on the Hugging Face Hub. | | `texts` | the test split of `abisee/cnn_dailymail` 3.0.0 | Parquet file or glob, as a DuckDB path. | | `text_column` | `article` | Column holding each text. | | `limit` | `200` | Texts to read. | @@ -43,7 +43,7 @@ installs. | `labels` | `person,organization,location,date` | Entity types, as plain words. | | `shards` | `["0", "1", "2", "3"]` | One extraction task per element. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub dataset repo to upload the entities to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the entities to, as `data/train.parquet`. | The download and the upload read the secret `hf_token`. @@ -54,6 +54,6 @@ found in, its words, type, score and character offsets. ## Licenses -- Model: [urchade/gliner_small-v2.1](https://huggingface.co/urchade/gliner_small-v2.1), Apache-2.0; it loads the tokenizer of [microsoft/deberta-v3-small](https://huggingface.co/microsoft/deberta-v3-small), MIT, from the Hub. +- Model: [urchade/gliner_small-v2.1](https://huggingface.co/urchade/gliner_small-v2.1), Apache-2.0; it loads the tokenizer of [microsoft/deberta-v3-small](https://huggingface.co/microsoft/deberta-v3-small), MIT, from the Hugging Face Hub. - Dataset: [abisee/cnn_dailymail](https://huggingface.co/datasets/abisee/cnn_dailymail), Apache-2.0. - Packages the install step installs: GLiNER, Transformers and PyArrow (Apache-2.0), PyTorch (BSD-3-Clause), protobuf (BSD-3-Clause), with their dependencies under permissive licenses. diff --git a/workflows/entity-extraction/extract.py b/workflows/entity-extraction/extract.py index 8970a89..c643d36 100644 --- a/workflows/entity-extraction/extract.py +++ b/workflows/entity-extraction/extract.py @@ -14,7 +14,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Directory or Hub repo id of the GLiNER model") + p.add_argument("--model", required=True, help="Directory or Hugging Face repo id of the GLiNER model") p.add_argument("--texts", required=True, help="Parquet file with id and text columns") p.add_argument("--shard", type=int, required=True, help="This task's shard number") p.add_argument("--shards", type=int, required=True, help="How many shards there are") diff --git a/workflows/entity-extraction/workflow.yaml b/workflows/entity-extraction/workflow.yaml index 998b9bf..ee1f233 100644 --- a/workflows/entity-extraction/workflow.yaml +++ b/workflows/entity-extraction/workflow.yaml @@ -1,10 +1,10 @@ -name: Entity extraction with GLiNER +name: Extract named entities with GLiNER description: Extracts named entities of types you name from a collection of texts with GLiNER, with no training, in several parallel CPU tasks, and aggregates them with SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the GLiNER model. + description: Hugging Face repo id of the GLiNER model. default: urchade/gliner_small-v2.1 texts: description: Parquet file or glob of the texts, as a DuckDB path. @@ -28,7 +28,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub dataset repo to upload the entities to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the entities to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -137,7 +137,7 @@ blocks: upload: tasks: upload_entities: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/extractive-qa/README.md b/workflows/extractive-qa/README.md index 7799fbe..fadc1be 100644 --- a/workflows/extractive-qa/README.md +++ b/workflows/extractive-qa/README.md @@ -1,4 +1,4 @@ -# Extractive question answering +# Fine-tune a model for extractive question answering Fine-tunes a question-answering model to find the span of a document that answers a question, here on long COVID-19 research papers, starting from a @@ -31,7 +31,7 @@ only Python's standard library. | `eval_every` | `10` | One document in this many is held out, with its questions. | | `epochs` | `2` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/extractive-qa/preprocess.py b/workflows/extractive-qa/preprocess.py index 2c8d8ec..0f2b057 100644 --- a/workflows/extractive-qa/preprocess.py +++ b/workflows/extractive-qa/preprocess.py @@ -15,7 +15,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory whose tokenizer to use") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory whose tokenizer to use") p.add_argument("--train", required=True, help="Parquet file with id, question, context and answers columns") p.add_argument("--eval", required=True, help="Parquet file with id, question, context and answers columns") p.add_argument("--max-length", type=int, default=384) diff --git a/workflows/extractive-qa/train.py b/workflows/extractive-qa/train.py index c9c9370..5d84fb9 100644 --- a/workflows/extractive-qa/train.py +++ b/workflows/extractive-qa/train.py @@ -12,7 +12,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model to fine-tune") p.add_argument("--data", required=True, help="Directory holding the tokenized train windows") p.add_argument("--output", required=True, help="Directory the fine-tuned model is saved to") p.add_argument("--epochs", type=float, default=2) diff --git a/workflows/extractive-qa/workflow.yaml b/workflows/extractive-qa/workflow.yaml index 7b74073..360760c 100644 --- a/workflows/extractive-qa/workflow.yaml +++ b/workflows/extractive-qa/workflow.yaml @@ -1,10 +1,10 @@ -name: Extractive question answering -description: Fine-tunes a question-answering model to find answers inside long documents, with windowing on a CPU, training and scoring tokens on a GPU, and answer picking and exact match and F1 on a CPU. +name: Fine-tune a model for extractive question answering +description: Fine-tunes a question-answering model on a GPU to find answers inside long documents, with windowing, answer picking, exact match and F1 on CPUs. compute_type: cpu-4 inputs: model: - description: Hub repo id of the question-answering model to fine-tune. + description: Hugging Face repo id of the question-answering model to fine-tune. default: distilbert/distilbert-base-cased-distilled-squad data: description: Parquet file or glob of questions in SQuAD form (id, question, context, answers), as a DuckDB path. @@ -19,7 +19,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -153,7 +153,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/finetune-evaluate-quantize/README.md b/workflows/finetune-evaluate-quantize/README.md index 2c0b6cd..38301f6 100644 --- a/workflows/finetune-evaluate-quantize/README.md +++ b/workflows/finetune-evaluate-quantize/README.md @@ -3,7 +3,7 @@ The whole path from a base model to a quantized file that runs on a laptop: supervised fine-tuning with TRL, a benchmark score with lm-evaluation-harness, conversion to GGUF, 4-bit quantization with llama.cpp, and an upload to the -Hub. Evaluation and conversion run side by side once training is done. +Hugging Face Hub. Evaluation and conversion run side by side once training is done. | Step | Task definition | Compute | |------|-----------------|---------| @@ -25,11 +25,11 @@ in `tokenizer.json`. | Input | Default | Description | |-------|---------|-------------| | `model` | `Qwen/Qwen2.5-0.5B-Instruct` | Model to fine-tune. All of its weights are trained. | -| `dataset` | `HuggingFaceH4/ultrafeedback_binarized` | Hub dataset with a `messages` column. | +| `dataset` | `HuggingFaceH4/ultrafeedback_binarized` | Hugging Face dataset with a `messages` column. | | `split` | `train_sft[:5000]` | Split, or slice of one, to train on. | | `eval_tasks` | `gsm8k` | lm-evaluation-harness tasks, separated by commas. | | `preset` | `Q4_K_M` | llama.cpp quantization preset. | -| `hub_repo` | empty | Hub model repo to upload the quantized file to. | +| `hub_repo` | empty | Hugging Face model repo to upload the quantized file to. | Training and the upload read the secret `hf_token`. diff --git a/workflows/finetune-evaluate-quantize/workflow.yaml b/workflows/finetune-evaluate-quantize/workflow.yaml index 130d3e9..bf62868 100644 --- a/workflows/finetune-evaluate-quantize/workflow.yaml +++ b/workflows/finetune-evaluate-quantize/workflow.yaml @@ -1,13 +1,13 @@ name: Fine-tune evaluate quantize and publish -description: Fine-tunes a small chat model with TRL, evaluates it with lm-evaluation-harness, converts it to GGUF, quantizes it, and uploads the quantized file to the Hub. +description: Fine-tunes a small chat model with TRL, evaluates it with lm-evaluation-harness, converts it to GGUF, quantizes it, and uploads it to the Hugging Face Hub. compute_type: cpu-4 inputs: model: - description: Hub repo id of the model to fine-tune. The whole model is trained, so keep it small or raise the compute type. + description: Hugging Face repo id of the model to fine-tune. The whole model is trained, so keep it small or raise the compute type. default: Qwen/Qwen2.5-0.5B-Instruct dataset: - description: Hub dataset with a messages column of chat turns. + description: Hugging Face dataset with a messages column of chat turns. default: HuggingFaceH4/ultrafeedback_binarized split: description: Split of the dataset to train on; a slice such as train_sft[:5000] trains on part of it. @@ -19,7 +19,7 @@ inputs: description: llama.cpp quantization preset. default: Q4_K_M hub_repo: - description: Hub model repo to upload the quantized GGUF file to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the quantized GGUF file to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -122,7 +122,7 @@ blocks: upload: tasks: upload_gguf: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/generate-responses/README.md b/workflows/generate-responses/README.md index 32281fb..6d89fb4 100644 --- a/workflows/generate-responses/README.md +++ b/workflows/generate-responses/README.md @@ -11,7 +11,7 @@ column that holds the prompts. | Write the requests: number the prompts and turn each into an OpenAI batch request | `swaleio/duckdb` | `cpu-4` | | Generate the answers | `swaleio/vllm-batch` | `a100-1` | | Join answers to prompts, count how each answer ended, write Parquet | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task; only generation holds a GPU. @@ -19,12 +19,12 @@ Every step is its own task; only generation holds a GPU. | Input | Default | Description | |-------|---------|-------------| -| `model` | `Qwen/Qwen2.5-1.5B-Instruct` | Chat model on the Hub. | +| `model` | `Qwen/Qwen2.5-1.5B-Instruct` | Chat model on the Hugging Face Hub. | | `prompts` | `hf://datasets/openai/gsm8k/main/test-*.parquet` | Parquet file or glob with the prompts, as a DuckDB path. | | `prompt_column` | `question` | Column that holds each prompt. | | `limit` | `200` | Number of prompts to answer. | | `max_tokens` | `512` | Longest answer, in tokens. | -| `hub_repo` | empty | Hub dataset repo to upload `responses.parquet` to; empty keeps it on the workspace. | +| `hub_repo` | empty | Hugging Face dataset repo to upload `responses.parquet` to; empty keeps it on the workspace. | The model download and the upload read the secret `hf_token`; the upload needs a token with write access. diff --git a/workflows/generate-responses/workflow.yaml b/workflows/generate-responses/workflow.yaml index b691c91..e54c555 100644 --- a/workflows/generate-responses/workflow.yaml +++ b/workflows/generate-responses/workflow.yaml @@ -4,7 +4,7 @@ compute_type: cpu-4 inputs: model: - description: Hub repo id of the chat model that answers. + description: Hugging Face repo id of the chat model that answers. default: Qwen/Qwen2.5-1.5B-Instruct prompts: description: Parquet file or glob holding the prompts, as a DuckDB path such as hf://datasets///. @@ -19,7 +19,7 @@ inputs: description: Longest answer, in tokens. default: "512" hub_repo: - description: Hub dataset repo to upload the answers to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the answers to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -95,7 +95,7 @@ blocks: upload: tasks: upload_answers: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/grpo-math/README.md b/workflows/grpo-math/README.md index 0c8192f..c45031b 100644 --- a/workflows/grpo-math/README.md +++ b/workflows/grpo-math/README.md @@ -24,7 +24,7 @@ trains. |-------|---------|-------------| | `model` | `Qwen/Qwen2.5-0.5B-Instruct` | Chat model to train; all of its weights are trained. | | `train_questions` | `2000` | GSM8K training questions to train on. | -| `hub_repo` | empty | Hub model repo to upload the trained model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the trained model to. | Training, the base model's evaluation and the upload read the secret `hf_token`. diff --git a/workflows/grpo-math/workflow.yaml b/workflows/grpo-math/workflow.yaml index 4d4a32f..6bcab77 100644 --- a/workflows/grpo-math/workflow.yaml +++ b/workflows/grpo-math/workflow.yaml @@ -4,13 +4,13 @@ compute_type: cpu-4 inputs: model: - description: Hub repo id of the chat model to train. All of its weights are trained. + description: Hugging Face repo id of the chat model to train. All of its weights are trained. default: Qwen/Qwen2.5-0.5B-Instruct train_questions: description: Number of GSM8K training questions to train on. default: "2000" hub_repo: - description: Hub model repo to upload the trained model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the trained model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -116,7 +116,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/image-classification/README.md b/workflows/image-classification/README.md index caf1515..bb82f91 100644 --- a/workflows/image-classification/README.md +++ b/workflows/image-classification/README.md @@ -1,4 +1,4 @@ -# Image classification +# Fine-tune a vision transformer for image classification Fine-tunes a vision transformer to put images into classes, here bean leaves into healthy, angular leaf spot and bean rust, and measures it on held-out @@ -32,7 +32,7 @@ model the same question without training it; compare the two. | `labels` | `angular_leaf_spot,bean_rust,healthy` | Label names in label-number order. | | `epochs` | `5` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/image-classification/train.py b/workflows/image-classification/train.py index 40a3e39..da7e816 100644 --- a/workflows/image-classification/train.py +++ b/workflows/image-classification/train.py @@ -12,7 +12,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model to fine-tune") p.add_argument("--data", required=True, help="Directory holding the prepared train and eval splits") p.add_argument("--labels", help="Label names, separated by commas, in label-number order") p.add_argument("--regression", action="store_true", help="Predict one number per image instead of a class") diff --git a/workflows/image-classification/workflow.yaml b/workflows/image-classification/workflow.yaml index c48cc08..75dd4bf 100644 --- a/workflows/image-classification/workflow.yaml +++ b/workflows/image-classification/workflow.yaml @@ -1,10 +1,10 @@ -name: Image classification -description: Fine-tunes a vision transformer to classify images, with image checks and resizing on a CPU, training and prediction on a GPU, and accuracy and macro F1 computed in SQL. +name: Fine-tune a vision transformer for image classification +description: Fine-tunes a vision transformer to classify images, with resizing on a CPU, training and prediction on a GPU, and accuracy and macro F1 in SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the image model to fine-tune. + description: Hugging Face repo id of the image model to fine-tune. default: google/vit-base-patch16-224-in21k train_data: description: Parquet file or glob of training images with a Hugging Face Image column, as a DuckDB path. @@ -28,7 +28,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -155,7 +155,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/image-regression/README.md b/workflows/image-regression/README.md index 1a06ba2..da4bf0b 100644 --- a/workflows/image-regression/README.md +++ b/workflows/image-regression/README.md @@ -1,4 +1,4 @@ -# Image regression +# Fine-tune a vision transformer for image regression Fine-tunes a vision transformer to predict a number for each image. The default target is the number of objects annotated in each picture of a construction-site @@ -32,7 +32,7 @@ optimizer and the batches together on one GPU. | `target` | `len(objects.category)` | SQL expression giving the number to predict. | | `epochs` | `10` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/image-regression/workflow.yaml b/workflows/image-regression/workflow.yaml index 3ff0f51..61f0ccf 100644 --- a/workflows/image-regression/workflow.yaml +++ b/workflows/image-regression/workflow.yaml @@ -1,10 +1,10 @@ -name: Image regression +name: Fine-tune a vision transformer for image regression description: Fine-tunes a vision transformer to predict a number for each image, here how many objects are annotated in it, with error measures computed in SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the image model to fine-tune. + description: Hugging Face repo id of the image model to fine-tune. default: google/vit-base-patch16-224-in21k train_data: description: Parquet file or glob of training images with a Hugging Face Image column, as a DuckDB path. @@ -25,7 +25,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -146,7 +146,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/kto-alignment/README.md b/workflows/kto-alignment/README.md index 298a999..0376dbb 100644 --- a/workflows/kto-alignment/README.md +++ b/workflows/kto-alignment/README.md @@ -35,7 +35,7 @@ it is. A 0.5B model trains on one A100 this way; for larger models, add | `judge` | `Qwen/Qwen3-8B` | Judge model. | | `train_split` | `train_prefs[:10000]` | Pairs of `HuggingFaceH4/ultrafeedback_binarized` to train on. | | `eval_prompts` | `200` | Held-out prompts, from its `test_prefs` split. | -| `hub_repo` | empty | Hub model repo to upload the aligned model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the aligned model to. | The downloads, the training and the upload read the secret `hf_token`. diff --git a/workflows/kto-alignment/workflow.yaml b/workflows/kto-alignment/workflow.yaml index d54edbc..06cfa7e 100644 --- a/workflows/kto-alignment/workflow.yaml +++ b/workflows/kto-alignment/workflow.yaml @@ -1,13 +1,13 @@ name: Align a model with KTO -description: Aligns a chat model to answers labelled good or bad with TRL's KTO, then has a judge model compare its answers with the base model's on held-out prompts and reports the win rate. +description: Aligns a chat model to answers labelled good or bad with TRL's KTO, then measures its win rate against the base model on held-out prompts with a judge model. compute_type: cpu-4 inputs: model: - description: Hub repo id of the chat model to align. All of its weights are trained. + description: Hugging Face repo id of the chat model to align. All of its weights are trained. default: Qwen/Qwen2.5-0.5B-Instruct judge: - description: Hub repo id of the judge model. + description: Hugging Face repo id of the judge model. default: Qwen/Qwen3-8B train_split: description: Preference pairs to train on, from HuggingFaceH4/ultrafeedback_binarized; KTO splits each pair into a good and a bad answer. @@ -16,7 +16,7 @@ inputs: description: Number of held-out prompts the two models answer for the judge. default: "200" hub_repo: - description: Hub model repo to upload the aligned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the aligned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -193,7 +193,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/label-text/README.md b/workflows/label-text/README.md index 2b9b07e..091a70c 100644 --- a/workflows/label-text/README.md +++ b/workflows/label-text/README.md @@ -13,7 +13,7 @@ and prints a confusion table. | Label | `swaleio/vllm-batch` | `a100-1` | | Join labels to texts, count each label, write Parquet | `swaleio/duckdb` | `cpu-4` | | Measure agreement with existing labels, when `gold_column` is set | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task; only labelling holds a GPU. @@ -21,14 +21,14 @@ Every step is its own task; only labelling holds a GPU. | Input | Default | Description | |-------|---------|-------------| -| `model` | `Qwen/Qwen2.5-1.5B-Instruct` | Chat model on the Hub. | +| `model` | `Qwen/Qwen2.5-1.5B-Instruct` | Chat model on the Hugging Face Hub. | | `texts` | the test split of `google-research-datasets/poem_sentiment` | Parquet file or glob, as a DuckDB path. | | `text_column` | `verse_text` | Column holding each text. | | `labels` | `negative,positive,no_impact,mixed` | Labels the model chooses from, separated by commas. | | `instruction` | a sentiment instruction | What the model is told before each text. | | `gold_column` | `label` | Column of existing labels, given as each label's position in `labels` from 0; empty skips the comparison. | | `limit` | `1000` | Number of texts to label. | -| `hub_repo` | empty | Hub dataset repo to upload `labels.parquet` to. | +| `hub_repo` | empty | Hugging Face dataset repo to upload `labels.parquet` to. | The model download and the upload read the secret `hf_token`. diff --git a/workflows/label-text/workflow.yaml b/workflows/label-text/workflow.yaml index 25c3c1f..fa8a329 100644 --- a/workflows/label-text/workflow.yaml +++ b/workflows/label-text/workflow.yaml @@ -4,7 +4,7 @@ compute_type: cpu-4 inputs: model: - description: Hub repo id of the chat model that labels. + description: Hugging Face repo id of the chat model that labels. default: Qwen/Qwen2.5-1.5B-Instruct texts: description: Parquet file or glob holding the texts, as a DuckDB path such as hf://datasets///. @@ -25,7 +25,7 @@ inputs: description: Number of texts to label. default: "1000" hub_repo: - description: Hub dataset repo to upload the labels to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the labels to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -125,7 +125,7 @@ blocks: upload: tasks: upload_labels: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/llm-as-a-judge/README.md b/workflows/llm-as-a-judge/README.md index 68c1c9b..238047e 100644 --- a/workflows/llm-as-a-judge/README.md +++ b/workflows/llm-as-a-judge/README.md @@ -1,4 +1,4 @@ -# LLM as a judge +# Score answers with an LLM as a judge Scores a model's answers with a stronger model. The model under test answers every prompt; the judge reads each prompt and answer and rates the answer from diff --git a/workflows/llm-as-a-judge/workflow.yaml b/workflows/llm-as-a-judge/workflow.yaml index ee9df31..6eab657 100644 --- a/workflows/llm-as-a-judge/workflow.yaml +++ b/workflows/llm-as-a-judge/workflow.yaml @@ -1,13 +1,13 @@ -name: LLM as a judge +name: Score answers with an LLM as a judge description: Answers a set of prompts with one model, has a stronger judge model score every answer from 1 to 10, and summarises the scores. compute_type: cpu-4 inputs: model: - description: Hub repo id of the model whose answers are judged. + description: Hugging Face repo id of the model whose answers are judged. default: Qwen/Qwen2.5-1.5B-Instruct judge: - description: Hub repo id of the judge model. + description: Hugging Face repo id of the judge model. default: Qwen/Qwen3-8B prompts: description: Parquet file or glob holding the prompts, as a DuckDB path. diff --git a/workflows/merge-models/README.md b/workflows/merge-models/README.md index 33b4995..23c42a2 100644 --- a/workflows/merge-models/README.md +++ b/workflows/merge-models/README.md @@ -34,7 +34,7 @@ respects both parents. | `model_a` | `Qwen/Qwen2.5-0.5B-Instruct` | First fine-tune; the merge takes its tokenizer and chat template. | | `model_b` | `numind/NuExtract-1.5-tiny` | Second fine-tune: NuMind's model for extracting structured data from text. | | `eval_task` | `gsm8k` | lm-evaluation-harness task to score them on. | -| `hub_repo` | empty | Hub model repo to upload the merge to. | +| `hub_repo` | empty | Hugging Face model repo to upload the merge to. | The merge, the parents' evaluations and the upload read the secret `hf_token`. diff --git a/workflows/merge-models/workflow.yaml b/workflows/merge-models/workflow.yaml index 23135b3..59c8143 100644 --- a/workflows/merge-models/workflow.yaml +++ b/workflows/merge-models/workflow.yaml @@ -4,19 +4,19 @@ compute_type: cpu-4 inputs: base: - description: Hub repo id of the base model both fine-tunes come from. + description: Hugging Face repo id of the base model both fine-tunes come from. default: Qwen/Qwen2.5-0.5B model_a: - description: Hub repo id of the first fine-tune. + description: Hugging Face repo id of the first fine-tune. default: Qwen/Qwen2.5-0.5B-Instruct model_b: - description: Hub repo id of the second fine-tune. + description: Hugging Face repo id of the second fine-tune. default: numind/NuExtract-1.5-tiny eval_task: description: The lm-evaluation-harness task the merge and both parents are scored on. default: gsm8k hub_repo: - description: Hub model repo to upload the merge to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the merge to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -120,7 +120,7 @@ blocks: upload: tasks: upload_merge: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/object-detection/README.md b/workflows/object-detection/README.md index 33c65aa..c74f1af 100644 --- a/workflows/object-detection/README.md +++ b/workflows/object-detection/README.md @@ -1,4 +1,4 @@ -# Object detection +# Fine-tune an object detection model Fine-tunes an object detector, RT-DETRv2, to find and box chosen kinds of objects, here safety equipment and machinery on construction sites. The @@ -30,7 +30,7 @@ each image and turns its boxes into training targets inside it, on the fly. | `categories` | the dataset's 17 categories | Category names in category-number order. | | `epochs` | `30` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the detector to. | +| `hub_repo` | empty | Hugging Face model repo to upload the detector to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/object-detection/train.py b/workflows/object-detection/train.py index a037db7..4e6ce77 100644 --- a/workflows/object-detection/train.py +++ b/workflows/object-detection/train.py @@ -43,7 +43,7 @@ def collate(batch): def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the detector to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the detector to fine-tune") p.add_argument("--train", required=True, help="Parquet file of training images") p.add_argument("--coco", required=True, help="COCO annotations of the training images") p.add_argument("--categories", required=True, help="Category names, separated by commas, in category-number order") diff --git a/workflows/object-detection/workflow.yaml b/workflows/object-detection/workflow.yaml index 1ebf092..cdf7ae1 100644 --- a/workflows/object-detection/workflow.yaml +++ b/workflows/object-detection/workflow.yaml @@ -1,10 +1,10 @@ -name: Object detection -description: Fine-tunes an object detector on annotated images, with an annotation check and COCO conversion on a CPU, training and detection on a GPU, and COCO mean average precision and sample drawings on a CPU. +name: Fine-tune an object detection model +description: Fine-tunes an object detector on annotated images on a GPU, with annotation checks, COCO conversion, mean average precision and sample drawings on CPUs. compute_type: cpu-4 inputs: model: - description: Hub repo id of the object detector to fine-tune. + description: Hugging Face repo id of the object detector to fine-tune. default: PekingU/rtdetr_v2_r18vd train_data: description: Parquet file or glob of training images, with image_id, image and objects (bbox, category) columns, as a DuckDB path. @@ -22,7 +22,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned detector to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned detector to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -162,7 +162,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/ocr-pages/README.md b/workflows/ocr-pages/README.md index ef6341e..b579e04 100644 --- a/workflows/ocr-pages/README.md +++ b/workflows/ocr-pages/README.md @@ -27,7 +27,7 @@ model, such as `Qwen/Qwen3-VL-8B-Instruct`, reads those pages better. | Input | Default | Description | |-------|---------|-------------| | `pdf_url` | the Docling technical report on arXiv | URL of the PDF. | -| `model` | `Qwen/Qwen3-VL-2B-Instruct` | Vision-language model on the Hub that vLLM serves. | +| `model` | `Qwen/Qwen3-VL-2B-Instruct` | Vision-language model on the Hugging Face Hub that vLLM serves. | | `dpi` | `110` | Resolution the pages are rendered at. | The download reads the secret `hf_token`. diff --git a/workflows/ocr-pages/workflow.yaml b/workflows/ocr-pages/workflow.yaml index f7426c9..7a8f4e3 100644 --- a/workflows/ocr-pages/workflow.yaml +++ b/workflows/ocr-pages/workflow.yaml @@ -7,7 +7,7 @@ inputs: description: URL of the PDF to transcribe. default: https://arxiv.org/pdf/2408.09869v5 model: - description: Hub repo id of the vision-language model that reads the pages. + description: Hugging Face repo id of the vision-language model that reads the pages. default: Qwen/Qwen3-VL-2B-Instruct dpi: description: Resolution the pages are rendered at. diff --git a/workflows/pdfs-to-markdown/README.md b/workflows/pdfs-to-markdown/README.md index 478e58d..48d97a6 100644 --- a/workflows/pdfs-to-markdown/README.md +++ b/workflows/pdfs-to-markdown/README.md @@ -1,4 +1,4 @@ -# PDFs to a Markdown dataset +# Convert PDFs to a Markdown dataset Turns a list of PDFs into a text dataset. Each PDF is fetched and converted to Markdown by Docling in its own pair of tasks, and all the pairs run at the same @@ -10,7 +10,7 @@ document's source URL. | For each PDF: fetch it | `swaleio/http-request` | `cpu-4` | | For each PDF: convert it to Markdown, pictures marked by placeholders | `swaleio/docling` | `cpu-4` | | Gather the Markdown into `documents.parquet` | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task. Docling converts a 10-page paper in under a minute on a CPU compute type; give the convert task a GPU compute type for long @@ -21,7 +21,7 @@ documents. | Input | Default | Description | |-------|---------|-------------| | `pdf_urls` | three papers from arXiv | The PDFs, as a JSON array of URLs. | -| `hub_repo` | empty | Hub dataset repo to upload the dataset to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the dataset to, as `data/train.parquet`. | The upload reads the secret `hf_token`. diff --git a/workflows/pdfs-to-markdown/workflow.yaml b/workflows/pdfs-to-markdown/workflow.yaml index 4ffff36..764f179 100644 --- a/workflows/pdfs-to-markdown/workflow.yaml +++ b/workflows/pdfs-to-markdown/workflow.yaml @@ -1,4 +1,4 @@ -name: PDFs to a Markdown dataset +name: Convert PDFs to a Markdown dataset description: Converts a list of PDFs to Markdown with Docling, one task per document, and collects the results into one Parquet dataset. compute_type: cpu-4 @@ -7,7 +7,7 @@ inputs: description: The PDFs to convert, as a JSON array of URLs. default: '["https://arxiv.org/pdf/2408.09869v5", "https://arxiv.org/pdf/2501.17887v1", "https://arxiv.org/pdf/2305.14314v1"]' hub_repo: - description: Hub dataset repo to upload the dataset to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face dataset repo to upload the dataset to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -69,7 +69,7 @@ blocks: upload: tasks: upload_dataset: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/quantize-and-pick/README.md b/workflows/quantize-and-pick/README.md index c031202..d3902b6 100644 --- a/workflows/quantize-and-pick/README.md +++ b/workflows/quantize-and-pick/README.md @@ -1,4 +1,4 @@ -# Quantize and pick +# Quantize a model and pick the best preset Finds the smallest quantized version of a model that still holds up. The model is converted to a 16-bit GGUF file once; then each quantization preset is @@ -31,7 +31,7 @@ log, so they are there to read but do not take part in the pick. | `model` | `Qwen/Qwen2.5-1.5B-Instruct` | Model to quantize. | | `presets` | `Q3_K_M`, `Q4_K_M`, `Q5_K_M`, `Q6_K`, `Q8_0` | llama.cpp presets to try, as a JSON array. | | `max_increase` | `5` | Largest perplexity increase over the 16-bit file the chosen preset may have, in percent. | -| `hub_repo` | empty | Hub model repo to upload the chosen file to. | +| `hub_repo` | empty | Hugging Face model repo to upload the chosen file to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/quantize-and-pick/workflow.yaml b/workflows/quantize-and-pick/workflow.yaml index fa048b0..c0ce9db 100644 --- a/workflows/quantize-and-pick/workflow.yaml +++ b/workflows/quantize-and-pick/workflow.yaml @@ -1,10 +1,10 @@ -name: Quantize and pick -description: Converts a model to GGUF, quantizes it to several presets in parallel, measures each preset's perplexity and speed, and uploads the smallest one within a perplexity budget. +name: Quantize a model and pick the best preset +description: Converts a model to GGUF, quantizes it to several presets in parallel, measures their perplexity and speed, and uploads the smallest within a perplexity budget. compute_type: cpu-4 inputs: model: - description: Hub repo id of the model to quantize. + description: Hugging Face repo id of the model to quantize. default: Qwen/Qwen2.5-1.5B-Instruct presets: description: llama.cpp quantization presets to try, as a JSON array. @@ -13,7 +13,7 @@ inputs: description: Largest perplexity increase over the 16-bit file that the chosen preset may have, in percent. default: "5" hub_repo: - description: Hub model repo to upload the chosen file to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the chosen file to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -157,7 +157,7 @@ blocks: upload: tasks: upload_gguf: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/retrieval-index/README.md b/workflows/retrieval-index/README.md index fb4f334..f343112 100644 --- a/workflows/retrieval-index/README.md +++ b/workflows/retrieval-index/README.md @@ -20,7 +20,7 @@ cosine similarity, to show the index works. Every step is its own task. The embedding client is a short Python script inside the workflow that uses only the standard library. Docling counts each chunk's -tokens with a tokenizer it downloads from the Hub. +tokens with a tokenizer it downloads from the Hugging Face Hub. ## Inputs @@ -29,7 +29,7 @@ tokens with a tokenizer it downloads from the Hub. | `pdf_urls` | three papers from arXiv | The PDFs, as a JSON array of URLs. | | `model` | `BAAI/bge-small-en-v1.5` | Embedding model; the query must be embedded with the same one. | | `query` | a question about Docling's tables | A question to test the index with; leave double quotes out of it. | -| `hub_repo` | empty | Hub dataset repo to upload the index to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the index to, as `data/train.parquet`. | The upload reads the secret `hf_token`. diff --git a/workflows/retrieval-index/workflow.yaml b/workflows/retrieval-index/workflow.yaml index c8d0fdd..dbc44a8 100644 --- a/workflows/retrieval-index/workflow.yaml +++ b/workflows/retrieval-index/workflow.yaml @@ -1,5 +1,5 @@ name: Build a retrieval index -description: Converts PDFs to chunks of text with Docling, embeds every chunk with Text Embeddings Inference, stores chunks and vectors as a Parquet index, and answers a test query from it. +description: Splits PDFs into text chunks with Docling, embeds them with Text Embeddings Inference, stores them as a Parquet index, and answers a test query. compute_type: cpu-4 inputs: @@ -7,13 +7,13 @@ inputs: description: The PDFs to index, as a JSON array of URLs. default: '["https://arxiv.org/pdf/2408.09869v5", "https://arxiv.org/pdf/2501.17887v1", "https://arxiv.org/pdf/2305.14314v1"]' model: - description: Hub repo id of the embedding model. + description: Hugging Face repo id of the embedding model. default: BAAI/bge-small-en-v1.5 query: description: A question to test the index with. default: How does Docling recognise the structure of tables? hub_repo: - description: Hub dataset repo to upload the index to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face dataset repo to upload the index to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -159,7 +159,7 @@ blocks: upload: tasks: upload_index: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/reward-model/README.md b/workflows/reward-model/README.md index eecdcbd..990512f 100644 --- a/workflows/reward-model/README.md +++ b/workflows/reward-model/README.md @@ -25,7 +25,7 @@ The result can drive `swaleio/trl-grpo` or `swaleio/trl-rloo` through | `model` | `Qwen/Qwen2.5-0.5B-Instruct` | Model the reward model starts from; all of its weights are trained. | | `train_split` | `train_prefs[:20000]` | Pairs of `HuggingFaceH4/ultrafeedback_binarized` to train on. | | `eval_pairs` | `1000` | Held-out pairs, from its `test_prefs` split. | -| `hub_repo` | empty | Hub model repo to upload the reward model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the reward model to. | Training and the upload read the secret `hf_token`. diff --git a/workflows/reward-model/workflow.yaml b/workflows/reward-model/workflow.yaml index 5f19dbf..4e69a69 100644 --- a/workflows/reward-model/workflow.yaml +++ b/workflows/reward-model/workflow.yaml @@ -4,7 +4,7 @@ compute_type: cpu-4 inputs: model: - description: Hub repo id of the model the reward model starts from. All of its weights are trained. + description: Hugging Face repo id of the model the reward model starts from. All of its weights are trained. default: Qwen/Qwen2.5-0.5B-Instruct train_split: description: Preference pairs to train on, from HuggingFaceH4/ultrafeedback_binarized. @@ -13,7 +13,7 @@ inputs: description: Number of held-out pairs to score. default: "1000" hub_repo: - description: Hub model repo to upload the reward model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the reward model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -102,7 +102,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/rloo-math/README.md b/workflows/rloo-math/README.md index a404f62..ed835f8 100644 --- a/workflows/rloo-math/README.md +++ b/workflows/rloo-math/README.md @@ -23,7 +23,7 @@ trains. |-------|---------|-------------| | `model` | `Qwen/Qwen2.5-0.5B-Instruct` | Chat model to train; all of its weights are trained. | | `train_questions` | `2000` | GSM8K training questions to train on. | -| `hub_repo` | empty | Hub model repo to upload the trained model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the trained model to. | Training, the base model's evaluation and the upload read the secret `hf_token`. diff --git a/workflows/rloo-math/workflow.yaml b/workflows/rloo-math/workflow.yaml index e9f222c..e6d5d89 100644 --- a/workflows/rloo-math/workflow.yaml +++ b/workflows/rloo-math/workflow.yaml @@ -4,13 +4,13 @@ compute_type: cpu-4 inputs: model: - description: Hub repo id of the chat model to train. All of its weights are trained. + description: Hugging Face repo id of the chat model to train. All of its weights are trained. default: Qwen/Qwen2.5-0.5B-Instruct train_questions: description: Number of GSM8K training questions to train on. default: "2000" hub_repo: - description: Hub model repo to upload the trained model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the trained model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -116,7 +116,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/scans-to-text/README.md b/workflows/scans-to-text/README.md index b13fade..4c34681 100644 --- a/workflows/scans-to-text/README.md +++ b/workflows/scans-to-text/README.md @@ -1,4 +1,4 @@ -# Scanned images to text +# Extract text from scanned images with Tesseract Reads the text of scanned pages with Tesseract OCR. Each scan is fetched and read in its own tasks, all at the same time: once as plain text, and once as a @@ -12,7 +12,7 @@ Tesseract struggled with stand out. | For each scan: fetch it | `swaleio/http-request` | `cpu-4` | | For each scan: read its text, and its words with confidences, in parallel | `swaleio/tesseract` | `cpu-4` each | | Gather text and confidences into `scans.parquet` | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task. @@ -22,7 +22,7 @@ Every step is its own task. |-------|---------|-------------| | `image_urls` | two sample scans from Tesseract's test data | The scans, as a JSON array of URLs. | | `language` | `eng+deu+fra` | Tesseract language codes, joined with `+`. | -| `hub_repo` | empty | Hub dataset repo to upload the dataset to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the dataset to, as `data/train.parquet`. | The upload reads the secret `hf_token`. diff --git a/workflows/scans-to-text/workflow.yaml b/workflows/scans-to-text/workflow.yaml index 23f882e..3a83dfb 100644 --- a/workflows/scans-to-text/workflow.yaml +++ b/workflows/scans-to-text/workflow.yaml @@ -1,4 +1,4 @@ -name: Scanned images to text +name: Extract text from scanned images with Tesseract description: Reads the text of a list of scanned page images with Tesseract, one task per image, and collects the text and word confidences into one Parquet dataset. compute_type: cpu-4 @@ -10,7 +10,7 @@ inputs: description: Tesseract language code, or several joined with +. default: eng+deu+fra hub_repo: - description: Hub dataset repo to upload the dataset to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face dataset repo to upload the dataset to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -98,7 +98,7 @@ blocks: upload: tasks: upload_dataset: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/score-gguf/README.md b/workflows/score-gguf/README.md index 14393c0..a5a9229 100644 --- a/workflows/score-gguf/README.md +++ b/workflows/score-gguf/README.md @@ -30,7 +30,7 @@ it has none, and the report also says how often it boxed its answer. | Input | Default | Description | |-------|---------|-------------| -| `repo` | `Qwen/Qwen2.5-1.5B-Instruct-GGUF` | Hub repo holding the GGUF file. | +| `repo` | `Qwen/Qwen2.5-1.5B-Instruct-GGUF` | Hugging Face repo holding the GGUF file. | | `file` | `qwen2.5-1.5b-instruct-q4_k_m.gguf` | The file to score. | | `questions` | `200` | Questions from GSM8K's test split to answer. | | `shards` | `["0", "1", "2", "3"]` | One client task per element. | diff --git a/workflows/score-gguf/workflow.yaml b/workflows/score-gguf/workflow.yaml index 6ff0118..220fd5b 100644 --- a/workflows/score-gguf/workflow.yaml +++ b/workflows/score-gguf/workflow.yaml @@ -1,10 +1,10 @@ name: Score a GGUF model on a CPU -description: Serves a quantized GGUF model with llama.cpp on a CPU, has several client tasks answer GSM8K maths questions through it in parallel, one per shard, and reports the model's accuracy and speed. +description: Serves a quantized GGUF model with llama.cpp on a CPU, has parallel client tasks answer GSM8K maths questions through it, and reports accuracy and speed. compute_type: cpu-4 inputs: repo: - description: Hub repo id holding the GGUF file. + description: Hugging Face repo id holding the GGUF file. default: Qwen/Qwen2.5-1.5B-Instruct-GGUF file: description: The GGUF file to score. diff --git a/workflows/semantic-dedup/README.md b/workflows/semantic-dedup/README.md index 290ce19..abcc08a 100644 --- a/workflows/semantic-dedup/README.md +++ b/workflows/semantic-dedup/README.md @@ -1,4 +1,4 @@ -# Semantic deduplication +# Remove semantic duplicates from a dataset Removes rows that say nearly the same thing in different words, which exact deduplication misses. vLLM embeds every row, a short NumPy script compares @@ -15,7 +15,7 @@ different, so the threshold can be checked. | Collect the vectors and count failed requests; a row whose request failed is kept | `swaleio/duckdb` | `cpu-4` | | Find near-duplicate pairs and the rows to drop ([`similar_pairs.py`](similar_pairs.py)) | `swaleio/python-3-13` | `cpu-4` | | Show sample pairs, write the dataset without the dropped rows | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | **What stays one script:** the similarity step. Comparing every row with every other is one matrix product per block of rows, and grouping the pairs needs all @@ -31,7 +31,7 @@ of them at once. | `limit` | `20000` | Rows to deduplicate. | | `threshold` | `0.95` | Cosine similarity from which two rows are near-duplicates. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub dataset repo to upload the result to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the result to, as `data/train.parquet`. | The download and the upload read the secret `hf_token`. diff --git a/workflows/semantic-dedup/workflow.yaml b/workflows/semantic-dedup/workflow.yaml index 31c47cf..a766e44 100644 --- a/workflows/semantic-dedup/workflow.yaml +++ b/workflows/semantic-dedup/workflow.yaml @@ -1,10 +1,10 @@ -name: Semantic deduplication +name: Remove semantic duplicates from a dataset description: Embeds every row of a dataset with vLLM batch inference, finds pairs of rows that mean nearly the same, and writes the dataset without the near-duplicates. compute_type: cpu-4 inputs: model: - description: Hub repo id of an embedding model vLLM serves. + description: Hugging Face repo id of an embedding model vLLM serves. default: BAAI/bge-small-en-v1.5 dataset: description: Parquet file or glob, as a DuckDB path. @@ -22,7 +22,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub dataset repo to upload the deduplicated dataset to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face dataset repo to upload the deduplicated dataset to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -139,7 +139,7 @@ blocks: upload: tasks: upload_dataset: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/sentence-embeddings/README.md b/workflows/sentence-embeddings/README.md index e51f21f..a057dc2 100644 --- a/workflows/sentence-embeddings/README.md +++ b/workflows/sentence-embeddings/README.md @@ -1,4 +1,4 @@ -# Sentence embeddings for retrieval +# Fine-tune sentence embeddings for retrieval Fine-tunes a sentence-embedding model with Sentence Transformers so that a question lands close to the text that answers it, then checks that retrieval @@ -33,7 +33,7 @@ either. | `positive_column` | `answer` | Column holding the text that answers it. | | `epochs` | `1` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/sentence-embeddings/embed.py b/workflows/sentence-embeddings/embed.py index 7f11ee8..c712c95 100644 --- a/workflows/sentence-embeddings/embed.py +++ b/workflows/sentence-embeddings/embed.py @@ -13,7 +13,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model") p.add_argument("--pairs", required=True, help="Parquet file with id, anchor and positive columns") p.add_argument("--output", required=True, help="Parquet file the vectors are written to") args = p.parse_args() diff --git a/workflows/sentence-embeddings/train.py b/workflows/sentence-embeddings/train.py index 198e580..5948fdc 100644 --- a/workflows/sentence-embeddings/train.py +++ b/workflows/sentence-embeddings/train.py @@ -14,7 +14,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model to fine-tune") p.add_argument("--pairs", required=True, help="Parquet file with anchor and positive columns") p.add_argument("--output", required=True, help="Directory the fine-tuned model is saved to") p.add_argument("--epochs", type=float, default=1) diff --git a/workflows/sentence-embeddings/workflow.yaml b/workflows/sentence-embeddings/workflow.yaml index 1685e30..b5cbb04 100644 --- a/workflows/sentence-embeddings/workflow.yaml +++ b/workflows/sentence-embeddings/workflow.yaml @@ -1,10 +1,10 @@ -name: Sentence embeddings for retrieval -description: Fine-tunes a sentence-embedding model on question and answer pairs, embeds held-out pairs with the base and the fine-tuned model, and compares their retrieval recall and MRR in SQL. +name: Fine-tune sentence embeddings for retrieval +description: Fine-tunes a sentence-embedding model on question and answer pairs, then compares its retrieval recall and MRR with the base model's on held-out pairs in SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the sentence-embedding model to fine-tune. + description: Hugging Face repo id of the sentence-embedding model to fine-tune. default: sentence-transformers/all-MiniLM-L6-v2 train_data: description: Parquet file or glob of training pairs, as a DuckDB path. @@ -25,7 +25,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -162,7 +162,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/setfit-classifier/README.md b/workflows/setfit-classifier/README.md index a034eb1..347a2c0 100644 --- a/workflows/setfit-classifier/README.md +++ b/workflows/setfit-classifier/README.md @@ -1,4 +1,4 @@ -# Few-shot classifier with SetFit +# Train a few-shot classifier with SetFit Trains a text classifier from a few labelled examples per class with SetFit: it fine-tunes a sentence-embedding model on pairs of the examples, then fits a @@ -29,7 +29,7 @@ fine-tuning of the embedding model and fitting the head, both run inside one | `labels` | `negative,positive,no_impact,mixed` | Label names in label-number order. | | `per_label` | `16` | Training examples per label. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the classifier to. | +| `hub_repo` | empty | Hugging Face model repo to upload the classifier to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/setfit-classifier/train.py b/workflows/setfit-classifier/train.py index 5bbea76..906e383 100644 --- a/workflows/setfit-classifier/train.py +++ b/workflows/setfit-classifier/train.py @@ -14,7 +14,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the sentence-embedding model") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the sentence-embedding model") p.add_argument("--train", required=True, help="Parquet file with text and label columns") p.add_argument("--labels", required=True, help="Label names, separated by commas, in label-number order") p.add_argument("--output", required=True, help="Directory the trained classifier is saved to") diff --git a/workflows/setfit-classifier/workflow.yaml b/workflows/setfit-classifier/workflow.yaml index 9fa7504..5ec5947 100644 --- a/workflows/setfit-classifier/workflow.yaml +++ b/workflows/setfit-classifier/workflow.yaml @@ -1,10 +1,10 @@ -name: Few-shot classifier with SetFit +name: Train a few-shot classifier with SetFit description: Trains a text classifier from a handful of examples per label with SetFit, then predicts the eval split on a GPU and computes accuracy and macro F1 in SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the sentence-embedding model SetFit starts from. + description: Hugging Face repo id of the sentence-embedding model SetFit starts from. default: sentence-transformers/all-MiniLM-L6-v2 train_data: description: Parquet file or glob to draw the few training examples from, as a DuckDB path. @@ -28,7 +28,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the classifier to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the classifier to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -146,7 +146,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/speech-dataset/README.md b/workflows/speech-dataset/README.md index c416093..acec33e 100644 --- a/workflows/speech-dataset/README.md +++ b/workflows/speech-dataset/README.md @@ -4,7 +4,7 @@ Turns long recordings into a speech-recognition dataset of short clips, each with its transcription. whisper.cpp transcribes every recording into segments with start and end times; FFmpeg cuts one clip per segment; and DuckDB packages the clips and their text as Parquet, with the audio in the shape of a Hugging -Face `Audio` column, ready for training or for the Hub. +Face `Audio` column, ready for training or for the Hugging Face Hub. | Step | Task definition | Compute | |------|-----------------|---------| @@ -14,7 +14,7 @@ Face `Audio` column, ready for training or for the Hub. | List the segments, keep those within the length range | `swaleio/duckdb` | `cpu-4` | | Cut one clip per kept segment | `swaleio/ffmpeg` | `cpu-4` | | Package clips and text into `speech.parquet` | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task. @@ -27,7 +27,7 @@ Every step is its own task. | `language` | `en` | Two-letter language code, or `auto`. | | `min_seconds` | `1` | Shortest clip kept. | | `max_seconds` | `30` | Longest clip kept. | -| `hub_repo` | empty | Hub dataset repo to upload the dataset to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the dataset to, as `data/train.parquet`. | The upload reads the secret `hf_token`. diff --git a/workflows/speech-dataset/workflow.yaml b/workflows/speech-dataset/workflow.yaml index f59f66a..0eb6a59 100644 --- a/workflows/speech-dataset/workflow.yaml +++ b/workflows/speech-dataset/workflow.yaml @@ -7,7 +7,7 @@ inputs: description: The recordings, as a JSON array of URLs or workspace paths; anything FFmpeg reads. default: '["https://archive.org/download/spc140_1502_librivox/spc140_blackvulture_wt_64kb.mp3", "https://archive.org/download/spc140_1502_librivox/spc140_gethsemane_db_64kb.mp3", "https://archive.org/download/spc140_1502_librivox/spc140_fromonewhostays_ss_64kb.mp3"]' whisper_model: - description: File name of the whisper.cpp model in ggerganov/whisper.cpp on the Hub. + description: File name of the whisper.cpp model in ggerganov/whisper.cpp on the Hugging Face Hub. default: ggml-large-v3-turbo-q5_0.bin language: description: Spoken language as a two-letter code, or auto. @@ -19,7 +19,7 @@ inputs: description: Longest clip to keep. default: "30" hub_repo: - description: Hub dataset repo to upload the dataset to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face dataset repo to upload the dataset to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -138,7 +138,7 @@ blocks: upload: tasks: upload_dataset: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/summarization/README.md b/workflows/summarization/README.md index c9c29ca..81ad617 100644 --- a/workflows/summarization/README.md +++ b/workflows/summarization/README.md @@ -1,4 +1,4 @@ -# Summarisation +# Fine-tune a model to write news summaries Fine-tunes a sequence-to-sequence model, such as Flan-T5, to summarise news articles, then generates a summary of every held-out article and scores the @@ -32,7 +32,7 @@ These scripts also serve the [translation](../translation) workflow. | `prefix` | `summarize: ` | Text put before every article, as T5 models expect. | | `epochs` | `1` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/summarization/generate.py b/workflows/summarization/generate.py index 399573c..5990fae 100644 --- a/workflows/summarization/generate.py +++ b/workflows/summarization/generate.py @@ -14,7 +14,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Directory or Hub repo id of the model") + p.add_argument("--model", required=True, help="Directory or Hugging Face repo id of the model") p.add_argument("--eval", required=True, help="Parquet file with source and target columns") p.add_argument("--output", required=True, help="Parquet file the generated texts are written to") p.add_argument("--prefix", default="", help="Text put before every source, as in training") diff --git a/workflows/summarization/preprocess.py b/workflows/summarization/preprocess.py index 0ada118..0da664e 100644 --- a/workflows/summarization/preprocess.py +++ b/workflows/summarization/preprocess.py @@ -12,7 +12,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory whose tokenizer to use") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory whose tokenizer to use") p.add_argument("--train", required=True, help="Parquet file with source and target columns") p.add_argument("--eval", required=True, help="Parquet file with source and target columns") p.add_argument("--prefix", default="", help="Text put before every source, such as 'summarize: ' for T5") diff --git a/workflows/summarization/train.py b/workflows/summarization/train.py index 69eebc7..3e72b9f 100644 --- a/workflows/summarization/train.py +++ b/workflows/summarization/train.py @@ -19,7 +19,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model to fine-tune") p.add_argument("--data", required=True, help="Directory holding the tokenized train and eval splits") p.add_argument("--output", required=True, help="Directory the fine-tuned model is saved to") p.add_argument("--epochs", type=float, default=3) diff --git a/workflows/summarization/workflow.yaml b/workflows/summarization/workflow.yaml index 5e6236e..3eeb12f 100644 --- a/workflows/summarization/workflow.yaml +++ b/workflows/summarization/workflow.yaml @@ -1,10 +1,10 @@ -name: Summarisation +name: Fine-tune a model to write news summaries description: Fine-tunes a sequence-to-sequence model to summarise news articles, with tokenizing on a CPU, training and generation on a GPU, and ROUGE computed on a CPU. compute_type: cpu-4 inputs: model: - description: Hub repo id of the sequence-to-sequence model to fine-tune. + description: Hugging Face repo id of the sequence-to-sequence model to fine-tune. default: google/flan-t5-small train_data: description: Parquet file or glob of training articles, as a DuckDB path. @@ -34,7 +34,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -157,7 +157,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/synthetic-reasoning-data/README.md b/workflows/synthetic-reasoning-data/README.md index e00583c..ee7b18b 100644 --- a/workflows/synthetic-reasoning-data/README.md +++ b/workflows/synthetic-reasoning-data/README.md @@ -1,4 +1,4 @@ -# Synthetic chain-of-thought data +# Generate synthetic chain-of-thought data Builds a reasoning dataset for fine-tuning. A reasoning model solves each question step by step; a second model, the judge, compares each solution's @@ -14,7 +14,7 @@ finishing are not judged. | Join solutions to questions, count unfinished ones, write one judge request per finished solution | `swaleio/duckdb` | `cpu-4` | | Judge | `swaleio/vllm-batch` | `a100-1` | | Keep the correct solutions as `messages` rows | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every step is its own task. The two GPU steps load different models, so each holds a GPU only for its own pass. @@ -30,7 +30,7 @@ holds a GPU only for its own pass. | `answer_column` | `answer` | Column holding each reference answer. | | `limit` | `500` | Number of questions. | | `max_tokens` | `4096` | Longest solution, reasoning included. | -| `hub_repo` | empty | Hub dataset repo to upload `reasoning-sft.parquet` to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload `reasoning-sft.parquet` to, as `data/train.parquet`. | The downloads and the upload read the secret `hf_token`. diff --git a/workflows/synthetic-reasoning-data/workflow.yaml b/workflows/synthetic-reasoning-data/workflow.yaml index 494227f..c5b1104 100644 --- a/workflows/synthetic-reasoning-data/workflow.yaml +++ b/workflows/synthetic-reasoning-data/workflow.yaml @@ -1,13 +1,13 @@ -name: Synthetic chain-of-thought data -description: Has a reasoning model solve maths questions step by step, has a judge model check each final answer against the reference, and keeps the correct solutions as a fine-tuning dataset. +name: Generate synthetic chain-of-thought data +description: Has a reasoning model solve maths questions step by step and a judge model check each answer, and keeps the correct solutions as a fine-tuning dataset. compute_type: cpu-4 inputs: generator: - description: Hub repo id of the model that writes the solutions. Qwen3 models reason inside tags before they answer. + description: Hugging Face repo id of the model that writes the solutions. Qwen3 models reason inside tags before they answer. default: Qwen/Qwen3-1.7B judge: - description: Hub repo id of the model that checks each final answer against the reference. + description: Hugging Face repo id of the model that checks each final answer against the reference. default: Qwen/Qwen3-8B questions: description: Parquet file or glob holding the questions and reference answers, as a DuckDB path. @@ -25,7 +25,7 @@ inputs: description: Longest solution, in tokens, reasoning included. default: "4096" hub_repo: - description: Hub dataset repo to upload the kept solutions to, as namespace/name. Leave empty to keep them on the workspace only. + description: Hugging Face dataset repo to upload the kept solutions to, as namespace/name. Leave empty to keep them on the workspace only. default: "" entry_point: main @@ -154,7 +154,7 @@ blocks: upload: tasks: upload_dataset: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/tabular/README.md b/workflows/tabular/README.md index b93bf54..1ae48d1 100644 --- a/workflows/tabular/README.md +++ b/workflows/tabular/README.md @@ -1,4 +1,4 @@ -# Tabular classification and regression +# Train a gradient-boosted model on tabular data Trains a gradient-boosted trees model on a table with scikit-learn, entirely on CPUs: DuckDB profiles the table and splits it, the model trains on one split, @@ -30,7 +30,7 @@ values. | `task` | `classification` | `classification` or `regression`. | | `test_percent` | `20` | Percentage of rows held out. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The upload reads the secret `hf_token`. diff --git a/workflows/tabular/workflow.yaml b/workflows/tabular/workflow.yaml index 8dfdbb1..6c4cad7 100644 --- a/workflows/tabular/workflow.yaml +++ b/workflows/tabular/workflow.yaml @@ -1,4 +1,4 @@ -name: Tabular classification and regression +name: Train a gradient-boosted model on tabular data description: Profiles a table and splits it with SQL, trains a gradient-boosted trees model with scikit-learn, and evaluates it on held-out rows, all on CPUs. compute_type: cpu-4 @@ -19,7 +19,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -101,7 +101,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/text-classification/README.md b/workflows/text-classification/README.md index 609396b..38914af 100644 --- a/workflows/text-classification/README.md +++ b/workflows/text-classification/README.md @@ -1,4 +1,4 @@ -# Text classification +# Fine-tune an encoder for text classification Fine-tunes an encoder model, such as ModernBERT, to put texts into classes, and measures it on held-out rows. The work is split so that only training and @@ -31,7 +31,7 @@ so it cannot be cut into tasks. | `labels` | `negative,positive,no_impact,mixed` | Label names in label-number order. | | `epochs` | `5` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/text-classification/preprocess.py b/workflows/text-classification/preprocess.py index 214fb2d..3d08f0d 100644 --- a/workflows/text-classification/preprocess.py +++ b/workflows/text-classification/preprocess.py @@ -12,7 +12,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory whose tokenizer to use") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory whose tokenizer to use") p.add_argument("--train", required=True, help="Parquet file with text and label columns") p.add_argument("--eval", required=True, help="Parquet file with text and label columns") p.add_argument("--max-length", type=int, default=256) diff --git a/workflows/text-classification/train.py b/workflows/text-classification/train.py index 392c968..775af0c 100644 --- a/workflows/text-classification/train.py +++ b/workflows/text-classification/train.py @@ -18,7 +18,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model to fine-tune") p.add_argument("--data", required=True, help="Directory holding the tokenized train and eval splits") p.add_argument("--labels", help="Label names, separated by commas, in label-number order") p.add_argument("--regression", action="store_true", help="Predict one number per text instead of a class") diff --git a/workflows/text-classification/workflow.yaml b/workflows/text-classification/workflow.yaml index bf6a363..e14f7c4 100644 --- a/workflows/text-classification/workflow.yaml +++ b/workflows/text-classification/workflow.yaml @@ -1,10 +1,10 @@ -name: Text classification +name: Fine-tune an encoder for text classification description: Fine-tunes an encoder model to classify text, with tokenizing on a CPU, training and prediction on a GPU, and accuracy and macro F1 computed in SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the encoder model to fine-tune. + description: Hugging Face repo id of the encoder model to fine-tune. default: answerdotai/ModernBERT-base train_data: description: Parquet file or glob of training rows, as a DuckDB path. @@ -28,7 +28,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -153,7 +153,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/text-regression/README.md b/workflows/text-regression/README.md index fb14396..5c6ec8b 100644 --- a/workflows/text-regression/README.md +++ b/workflows/text-regression/README.md @@ -1,4 +1,4 @@ -# Text regression +# Fine-tune an encoder for text regression Fine-tunes an encoder model to predict a number for each text. The default data is FineWeb-Edu's set of web pages scored from 0 to 5 for educational value, the @@ -33,7 +33,7 @@ optimizer and the batches together on one GPU. | `train_rows`, `eval_rows` | `20000`, `2000` | Rows to use from each. | | `epochs` | `2` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/text-regression/workflow.yaml b/workflows/text-regression/workflow.yaml index d5967dc..fc07c96 100644 --- a/workflows/text-regression/workflow.yaml +++ b/workflows/text-regression/workflow.yaml @@ -1,10 +1,10 @@ -name: Text regression -description: Fine-tunes an encoder model to predict a number for each text, here an educational-value score, with tokenizing on a CPU, training on a GPU, and error measures computed in SQL. +name: Fine-tune an encoder for text regression +description: Fine-tunes an encoder model to predict a number for each text, here an educational-value score, with training on a GPU and error measures in SQL. compute_type: cpu-4 inputs: model: - description: Hub repo id of the encoder model to fine-tune. + description: Hugging Face repo id of the encoder model to fine-tune. default: answerdotai/ModernBERT-base train_data: description: Parquet file or glob of training rows, as a DuckDB path. @@ -31,7 +31,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -152,7 +152,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/token-classification/README.md b/workflows/token-classification/README.md index 61aae7f..0157155 100644 --- a/workflows/token-classification/README.md +++ b/workflows/token-classification/README.md @@ -1,4 +1,4 @@ -# Token classification +# Fine-tune an encoder for token classification Fine-tunes an encoder model to tag named entities, word by word, and scores it the way named-entity recognition is usually scored: an entity counts only when @@ -31,7 +31,7 @@ standard library. | `tags_column` | `ner_tags` | Column holding the IOB2 tags, such as `B-Telescope`. | | `epochs` | `4` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. diff --git a/workflows/token-classification/preprocess.py b/workflows/token-classification/preprocess.py index 3ed1063..5ceb2af 100644 --- a/workflows/token-classification/preprocess.py +++ b/workflows/token-classification/preprocess.py @@ -14,7 +14,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory whose tokenizer to use") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory whose tokenizer to use") p.add_argument("--train", required=True, help="Parquet file with tokens and tags columns") p.add_argument("--eval", required=True, help="Parquet file with tokens and tags columns") p.add_argument("--max-length", type=int, default=512) diff --git a/workflows/token-classification/train.py b/workflows/token-classification/train.py index 5a9a9b4..d115d82 100644 --- a/workflows/token-classification/train.py +++ b/workflows/token-classification/train.py @@ -19,7 +19,7 @@ def main(): p = argparse.ArgumentParser() - p.add_argument("--model", required=True, help="Hub repo id or directory of the model to fine-tune") + p.add_argument("--model", required=True, help="Hugging Face repo id or directory of the model to fine-tune") p.add_argument("--data", required=True, help="Directory holding the tokenized splits and labels.json") p.add_argument("--output", required=True, help="Directory the fine-tuned model is saved to") p.add_argument("--epochs", type=float, default=3) diff --git a/workflows/token-classification/workflow.yaml b/workflows/token-classification/workflow.yaml index 34615a4..374aa4c 100644 --- a/workflows/token-classification/workflow.yaml +++ b/workflows/token-classification/workflow.yaml @@ -1,10 +1,10 @@ -name: Token classification -description: Fine-tunes an encoder model to tag named entities word by word, with tag alignment on a CPU, training and tagging on a GPU, and entity-level F1 computed on a CPU. +name: Fine-tune an encoder for token classification +description: Fine-tunes an encoder model to tag named entities word by word, with tag alignment on a CPU, training and tagging on a GPU, and entity-level F1 on a CPU. compute_type: cpu-4 inputs: model: - description: Hub repo id of the encoder model to fine-tune; its tokenizer must accept text already split into words. + description: Hugging Face repo id of the encoder model to fine-tune; its tokenizer must accept text already split into words. default: google-bert/bert-base-cased train_data: description: Parquet file or glob of training sentences, as a DuckDB path. @@ -25,7 +25,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -139,7 +139,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/train-then-serve/README.md b/workflows/train-then-serve/README.md index 053c71a..41f1ff0 100644 --- a/workflows/train-then-serve/README.md +++ b/workflows/train-then-serve/README.md @@ -1,4 +1,4 @@ -# Train then serve +# Fine-tune a model then serve it with vLLM Fine-tunes a small chat model and serves it right away through vLLM's OpenAI-compatible server, inside the same run. A smoke test waits for the @@ -22,7 +22,7 @@ Every step is its own task. | Input | Default | Description | |-------|---------|-------------| | `model` | `Qwen/Qwen2.5-0.5B-Instruct` | Model to fine-tune. | -| `dataset` | `HuggingFaceH4/ultrafeedback_binarized` | Hub dataset with a `messages` column. | +| `dataset` | `HuggingFaceH4/ultrafeedback_binarized` | Hugging Face dataset with a `messages` column. | | `split` | `train_sft[:5000]` | Split, or slice of one, to train on. | | `question` | a question about fine-tuning | What the smoke test asks. | diff --git a/workflows/train-then-serve/workflow.yaml b/workflows/train-then-serve/workflow.yaml index 15f7fa5..c1cb977 100644 --- a/workflows/train-then-serve/workflow.yaml +++ b/workflows/train-then-serve/workflow.yaml @@ -1,13 +1,13 @@ -name: Train then serve +name: Fine-tune a model then serve it with vLLM description: Fine-tunes a small chat model with TRL, serves the result through vLLM's OpenAI-compatible server, and checks it answers. compute_type: cpu-4 inputs: model: - description: Hub repo id of the model to fine-tune. + description: Hugging Face repo id of the model to fine-tune. default: Qwen/Qwen2.5-0.5B-Instruct dataset: - description: Hub dataset with a messages column of chat turns. + description: Hugging Face dataset with a messages column of chat turns. default: HuggingFaceH4/ultrafeedback_binarized split: description: Split of the dataset to train on. diff --git a/workflows/transcribe-audio/workflow.yaml b/workflows/transcribe-audio/workflow.yaml index 16029fb..475fb09 100644 --- a/workflows/transcribe-audio/workflow.yaml +++ b/workflows/transcribe-audio/workflow.yaml @@ -7,7 +7,7 @@ inputs: description: The audio or video files, as a JSON array of URLs or workspace paths; anything FFmpeg reads. default: '["https://archive.org/download/spc140_1502_librivox/spc140_blackvulture_wt_64kb.mp3", "https://archive.org/download/spc140_1502_librivox/spc140_gethsemane_db_64kb.mp3", "https://archive.org/download/spc140_1502_librivox/spc140_fromonewhostays_ss_64kb.mp3"]' whisper_model: - description: File name of the whisper.cpp model in ggerganov/whisper.cpp on the Hub. + description: File name of the whisper.cpp model in ggerganov/whisper.cpp on the Hugging Face Hub. default: ggml-large-v3-turbo-q5_0.bin language: description: Spoken language as a two-letter code, or auto. diff --git a/workflows/translation/README.md b/workflows/translation/README.md index ea11581..8399722 100644 --- a/workflows/translation/README.md +++ b/workflows/translation/README.md @@ -1,4 +1,4 @@ -# Translation +# Fine-tune a translation model Fine-tunes a translation model on sentence pairs, then translates every held-out sentence and scores the translations with BLEU and chrF. The default @@ -32,7 +32,7 @@ optimizer and the batches together on one GPU. | `prefix` | empty | Text put before every source, for models that expect one. | | `epochs` | `3` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download and the upload read the secret `hf_token`. The prepare step reads WMT24++'s `is_bad_source`, `document_id` and `segment_id` columns; edit it for diff --git a/workflows/translation/workflow.yaml b/workflows/translation/workflow.yaml index 68c3eef..cfd5d79 100644 --- a/workflows/translation/workflow.yaml +++ b/workflows/translation/workflow.yaml @@ -1,10 +1,10 @@ -name: Translation +name: Fine-tune a translation model description: Fine-tunes a translation model on sentence pairs, with tokenizing on a CPU, training and generation on a GPU, and BLEU and chrF computed on a CPU. compute_type: cpu-4 inputs: model: - description: Hub repo id of the sequence-to-sequence model to fine-tune. + description: Hugging Face repo id of the sequence-to-sequence model to fine-tune. default: Helsinki-NLP/opus-mt-de-en pairs: description: JSON Lines or Parquet file of sentence pairs, as a DuckDB path. @@ -28,7 +28,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -153,7 +153,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/vlm-finetune/README.md b/workflows/vlm-finetune/README.md index c3028e5..97e0345 100644 --- a/workflows/vlm-finetune/README.md +++ b/workflows/vlm-finetune/README.md @@ -32,7 +32,7 @@ answers while the other one trains. | `question` | a question about the leaf | What is asked about every image. | | `epochs` | `3` | Training epochs. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub model repo to upload the model to. | +| `hub_repo` | empty | Hugging Face model repo to upload the model to. | The download, the training and the upload read the secret `hf_token`. diff --git a/workflows/vlm-finetune/workflow.yaml b/workflows/vlm-finetune/workflow.yaml index 3b04066..977df66 100644 --- a/workflows/vlm-finetune/workflow.yaml +++ b/workflows/vlm-finetune/workflow.yaml @@ -1,10 +1,10 @@ name: Fine-tune a vision-language model -description: Fine-tunes a small vision-language model to answer a question about images with TRL, then has the base and the fine-tuned model answer held-out images through vLLM and compares their accuracy. +description: Fine-tunes a small vision-language model with TRL to answer a question about images, then compares its accuracy with the base model's on held-out images. compute_type: cpu-4 inputs: model: - description: Hub repo id of the vision-language model to fine-tune. All of its weights are trained. + description: Hugging Face repo id of the vision-language model to fine-tune. All of its weights are trained. default: HuggingFaceTB/SmolVLM-256M-Instruct train_data: description: Parquet file or glob of training images with a Hugging Face Image column and a label column, as a DuckDB path. @@ -25,7 +25,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face model repo to upload the fine-tuned model to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -190,7 +190,7 @@ blocks: upload: tasks: upload_model: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}} diff --git a/workflows/web-text-curation/README.md b/workflows/web-text-curation/README.md index 8a1b77e..2f4af44 100644 --- a/workflows/web-text-curation/README.md +++ b/workflows/web-text-curation/README.md @@ -1,4 +1,4 @@ -# Web text curation with datatrove +# Curate web text with datatrove Cleans web text the way pre-training datasets such as FineWeb are built, with Hugging Face's datatrove: quality rules drop pages of boilerplate, lists and @@ -17,7 +17,7 @@ pipeline, and a last step counts what each stage kept and dropped. | Group them into clusters of near-duplicates (`clusters`) | `swaleio/python-3-13` | `cpu-4` | | Keep one document per cluster (`dedup`) | `swaleio/python-3-13` | `cpu-4` | | Count each outcome, write `curated.parquet` | `swaleio/duckdb` | `cpu-4` | -| Upload to the Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | +| Upload to the Hugging Face Hub, when `hub_repo` is set | `swaleio/hf-upload` | `cpu-4` | Every stage is its own task. Dropped documents are kept apart with the rule that dropped them, under `curation/removed/`. @@ -38,7 +38,7 @@ for multilingual input once you have checked its model's license. | `data` | one shard of `HuggingFaceFW/fineweb`'s 10BT sample | Parquet file or glob with `id` and `text`, as a DuckDB path. | | `documents` | `20000` | Documents to curate. | | `examples_ref` | `main` | Branch, tag or full commit SHA of this repository whose scripts run. | -| `hub_repo` | empty | Hub dataset repo to upload the curated text to, as `data/train.parquet`. | +| `hub_repo` | empty | Hugging Face dataset repo to upload the curated text to, as `data/train.parquet`. | The upload reads the secret `hf_token`. diff --git a/workflows/web-text-curation/workflow.yaml b/workflows/web-text-curation/workflow.yaml index 901a50a..c22401d 100644 --- a/workflows/web-text-curation/workflow.yaml +++ b/workflows/web-text-curation/workflow.yaml @@ -1,5 +1,5 @@ -name: Web text curation with datatrove -description: Cleans a sample of web text the way pre-training datasets are built, with datatrove quality filters and MinHash near-duplicate removal, one task per stage, all on CPUs. +name: Curate web text with datatrove +description: Cleans a sample of web text the way pre-training datasets are built, with datatrove quality filters and MinHash deduplication, one task per stage, all on CPUs. compute_type: cpu-4 inputs: @@ -13,7 +13,7 @@ inputs: description: Branch, tag or full commit SHA of swaleio/examples whose scripts run. default: main hub_repo: - description: Hub dataset repo to upload the curated text to, as namespace/name. Leave empty to keep it on the workspace only. + description: Hugging Face dataset repo to upload the curated text to, as namespace/name. Leave empty to keep it on the workspace only. default: "" entry_point: main @@ -155,7 +155,7 @@ blocks: upload: tasks: upload_text: - name: Upload to the Hub + name: Upload to the Hugging Face Hub uses: swaleio/hf-upload args: repo: ${{inputs.hub_repo}}