Text Classification
Laya
Safetensors
English
ledgar
lexglue
legal
contracts
calibrated
selective-prediction
Eval Results (legacy)
Instructions to use VibeHash/laya-ledgar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use VibeHash/laya-ledgar with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 2,413 Bytes
779ff0b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # 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.
```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 <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`.
|