laya-ledgar / code /README.md
VibeHash's picture
Release laya-ledgar, run ce-seed0
779ff0b verified
|
Raw History Blame Contribute Delete
2.41 kB

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/<task>/ (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.

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 <task>                 # the source at a pinned revision; writes and locks the test
python -m layatasks.fit <task>                  # token budget and a time estimate, on the CPU
python -m layatasks.evaluate <task> --model base --name zero-shot
python -m layatasks.train <task> --seed 0
python -m layatasks.evaluate <task> --model ~/.laya-tasks/<task>/runs/seed0/model --name seed0
python -m layatasks.compare <task> zero-shot seed0
python -m layatasks.package <task> seed0 --repo <user>/laya-<task>
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/<task>.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.