Repository navigation
Add 43 example workflows for Hugging Face-style jobs - #2
Merged
Merged
Conversation
- Load image batches in-process: DataLoader workers ran out of a container's 64 MB /dev/shm and object detection then hung. - semantic-dedup cuts texts longer than the embedding model takes and keeps rows whose request failed. - merge-models merges NuExtract-1.5-tiny, a fine-tune of Qwen2.5-0.5B; Qwen2.5-Coder is not one, and that merge answered with zeros. - Read the int size older image processor configs give, SetFit's list predictions, and match the llamacpp-convert page's tokenizer step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Datasets 5.2.0 cannot build a dataset in memory on Python 3.13, so image preprocessing writes memory-mapped pixel arrays with NumPy, read back through a small torch dataset, and vlm-finetune writes its rows with PyArrow. vlm-finetune's rows are now prompt and completion columns, so TRL computes the loss on the answer alone; over whole conversations the image's tokens drowned the label out and the model answered one class for every image. Object detection's training step installs SciPy, which RT-DETR's loss needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
git-clone now checks out its revision input, so the workflows that run scripts clone this repository at examples_ref instead of downloading and unpacking an archive. A revision is a branch, a tag or a full commit SHA; the input descriptions and READMEs say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serve-gguf repeated llamacpp-server's own example. score-gguf serves the model once, has four client tasks answer GSM8K questions through it at the same time, and scores the answers: 73.5% for Qwen2.5-1.5B-Instruct at Q4_K_M, at 147 tokens per second with the server on 16 CPUs. Import from GitHub reads only repositories on accounts the Swale GitHub App is installed on and the user can access, which this repository is not for anyone outside it. The README now says to upload the file, or to import from a fork. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The classify-images and tabular READMEs quoted the scores their defaults reached when run here. An example says what it does, not how it scored when it was tried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The error is not specific to Python 3.13: it comes from how datasets pickles PyArrow tables for fingerprinting, and an open pull request in datasets fixes it. The comment now points there, so the workaround can go once that fix is released. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both workflows had several tasks installing the same packages: one per shard in entity-extraction, one per stage in web-text-curation. An install step now puts them in packages/ on the workspace, and the tasks import them from there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
image-classification reads prepared, memory-mapped pixels, so it needs no DataLoader workers; its comment now says that. object-detection keeps the Trainer's default loader, with no comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each image is decoded and resized as its batch is built, so four loader workers prepare the next batches while the GPU trains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 43 example workflows for the jobs machine-learning teams run over and over, the ones Hugging Face offers as ready-made operations: batch inference and labelling with an LLM, building datasets from documents, images and audio, fine-tuning and aligning models, evaluating, merging, quantizing and serving them. Each workflow is built from the
swaleiotask definitions on Swale Hub and splits its job into separate tasks, so a run's graph shows each step, its logs and its outputs, and only the steps that need a GPU hold one.Layout
workflows/<name>/workflow.yamlworkflows/<name>/README.mdworkflows/<name>/*.pyrequirements/*.txttools/check_workflows.pyThe repository README lists every workflow, grouped by the kind of job.
How scripts run
A workflow that runs scripts first clones this repository into the workspace with
swaleio/git-clone, at itsexamples_refinput: a branch, a tag or a full commit SHA,mainby default. CPU steps run onswaleio/python-3-13and install their packages from arequirements/file into/tmp; GPU steps run onswaleio/transformers, which already holds PyTorch and Transformers, and install anything else they need the same way. entity-extraction and web-text-curation, where several tasks need the same packages, install them once instead, in a step of their own, intopackages/on the workspace, and their tasks import them from there. Every script was written for this repository.Scripts are split as far as a step's state allows: preparing, tokenizing, training, predicting and scoring are separate tasks, and only training and prediction hold a GPU. What stays one script is the training loop, which holds the model, the optimizer and the batches together on one GPU; each README says so.
The check
tools/check_workflows.pychecks each workflow against a checkout ofswaleio/task-definitions: the keys the workflow syntax allows, compute types, that each task names a definition without a version, passes only the inputs it declares and every input it requires, runs GPU definitions on GPU compute, that expressions name declared inputs and tasks, and that every script compiles.CI checks every workflow against the catalog's
main. With swaleio/task-definitions#102 merged, all 43 pass.Licenses
The default models and datasets are under licenses that allow commercial use; each README names them. Every package a script step installs was checked, with the libraries its Linux wheel bundles as its license files list them. All are under permissive licenses except these, which are installed from PyPI unmodified:
certifi(MPL-2.0) andtqdm(MPL-2.0 and MIT).libgfortran, in NumPy and SciPy, andlibgomp, in scikit-learn and sentencepiece: GPL-3.0-or-later with the GCC Runtime Library Exception.libquadmathin SciPy (LGPL-2.1-or-later), which tabular, object-detection and sentence-embeddings install, andlibiconvlinked into lxml (LGPL-2.1), which translation's scoring step installs.🤖 Generated with Claude Code