# laya-tasks: code The code that builds, scores and packages the Laya fine-tunes `laya-clinc150` and `laya-ledgar` on Hugging Face. Each model card there has the results, how to use the model and its limits. This folder is how to make a model again and check its numbers. A model repository carries the shared steps and its own task module only. Everything runs on one GPU. Data, weights and runs go under `~/.laya-tasks//` (set `LAYA_TASKS_HOME` to move it). Set `LAYA_BASE` to a local copy of the base Laya checkpoint to skip downloading it; its weights are still checked against the pinned SHA-256. ```bash pip install torch --index-url https://download.pytorch.org/whl/cu126 # or the build for your GPU pip install -r requirements.txt python -m layatasks.data # the source at a pinned revision; writes and locks the test python -m layatasks.fit # token budget and a time estimate, on the CPU python -m layatasks.evaluate --model base --name zero-shot python -m layatasks.train --seed 0 python -m layatasks.evaluate --model ~/.laya-tasks//runs/seed0/model --name seed0 python -m layatasks.compare zero-shot seed0 python -m layatasks.package seed0 --repo /laya- python -m unittest discover -s tests -t . ``` | Module | What it does | |---|---| | `layatasks/task.py` | What a task is: its pinned source, its one question, its training settings | | `layatasks/tasks/.py` | One task: `clinc150` (150 intents and out-of-scope queries), `ledgar` (100 contract provision types) | | `layatasks/data.py` | Downloads the source at a pinned revision, checks its SHA-256, writes Laya's rows, locks the test file | | `layatasks/fit.py` | Counts the rows Laya would cut short and estimates the fine-tune's time from one measured run | | `layatasks/train.py` | Laya's own `finetune` with the task's settings | | `layatasks/evaluate.py` | Scores a checkpoint through `laya.load(...).predict_batch`: accuracy, interval, calibration, threshold, speed, and the task's own numbers | | `layatasks/compare.py` | Compares two runs text by text, with the exact McNemar test | | `layatasks/package.py` | Assembles the folder uploaded as the model and checks it for local paths and unfilled card slots | | `layatasks/metrics.py` | The scores themselves, in plain Python | Apache 2.0 (`LICENSE`); credits in `NOTICE`.