Instructions to use Thoriumi/Fuuga-Laya-emotion-laya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Thoriumi/Fuuga-Laya-emotion-laya 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
Laya, retrained with Fuuga on Emotion (Laya format)
What this is. Laya, a typed-decision model
(ModernBERT-large encoder, 395M parameters, with its own two-layer decision head), imported whole
into Fuuga with fuuga import-laya, fine-tuned, head and
encoder together, on DAIR Emotion (6 classes), and written back with fuuga export laya in Laya's
own layout: the same files Laya's repository has, for Laya's own code to load.
Why it exists. A test case for Fuuga's Laya import and export pair: import a published decision
model exactly, retrain it on labelled data, measure it on the same rows before and after, and
hand it back in the format it came in. The same model with its encoder as Transformers'
ModernBertModel is the companion repository
Fuuga-Laya-emotion.
Files
| File | |
|---|---|
model.safetensors |
the encoder under encoder., the decision head under Laya's names (type_emb, head.layers.*, scorer.*, act_head.*) and the temperature buffer, F32 (1.7 GB) |
encoder/config.json |
the ModernBERT config Laya builds its encoder from; norm_bias is true, because fine-tuning moved the LayerNorm biases, which are written |
tokenizer/ |
Laya's tokenizer, unchanged |
rl_agent_config.json |
Laya's own settings (encoder name, act costs, precision) with this model's head size, input budget and temperatures; fuuga_act_head_current: false (see below) |
FUUGA_LAYA_EXPORT_NOTES.md |
what the export wrote and from where |
eval/ |
the evaluation reports of every model below, the paired comparisons and the training logs |
Training
| Data | DAIR Emotion (dair-ai/emotion): a fixed-seed sample of 4,000 training rows and 2,000 test rows from the published splits; the question "Which emotion does this message express?" over sadness, joy, love, anger, fear, surprise |
| Start | fuuga import-laya of Laya's root checkpoint, checked against Laya's own outputs (identical token ids and option markers, logits within 4e-6) |
| Method | fuuga decide train --decision-model: 3 epochs, batch 16, head at 1e-4, encoder at 2e-5, loss the log score, 512-token input budget (192 for question and options) |
| Hardware and time | RTX 4070 12 GB; 6.5 minutes |
Results
Held-out accuracy on the 2,000 test rows (chance 16.7%):
| Model | Accuracy | NLL | Brier | ECE | Acts at confidence ≥ 0.90 |
|---|---|---|---|---|---|
| Laya zero-shot, with its own temperatures | 58.7% | 1.963 | 0.702 | 0.305 | 68.3% of rows, 66.2% correct |
| Laya, fine-tuned (this model) | 89.9% | 0.525 | 0.173 | 0.074 | 92.3% of rows, 93.6% correct |
Paired on the same rows, this model is right on 679 of the 734 rows the two decide differently
(McNemar's exact test, p < 0.0001). The eval/ reports also hold Laya with only its head
retrained (58.6%) and the stock ModernBERT-large trained the same way (90.0% fine-tuned, a tie with
this model).
Using it
With Laya's own code, point it at this folder as at Laya's. Two differences from Laya:
- Temperatures are 1. The fine-tuned model has no fitted temperature table yet; its
probabilities are its raw ones (ECE 0.074 on the test rows). Fit one on held-out rows
(Fuuga's
decide calibrate, thenfuuga export laya --calibration) before relying on them. - The act head is Laya's, not refitted. Fuuga retrains the option scorer but not the act
head, so the act probability Laya reports does not describe this scorer; use the option
probabilities.
rl_agent_config.jsonrecords this asfuuga_act_head_current: false, which Laya ignores and Fuuga reads.
With Fuuga, fuuga import-laya --donor <this folder> --output laya-emotion gives the decision
model back; fuuga decide predict --decision-model laya-emotion ... or fuuga-serve --decision-model laya-emotion answers with it.
Verification
- Round trip in Fuuga: this folder re-imported with
fuuga import-layagives the trained model's prediction on all 2,000 test rows, byte for byte (examples/showcase/export-laya.ps1 -Format laya). - The export is the reverse of the import: Laya itself imported and exported without training gives back all 206 of its tensors value for value and its temperatures, and the re-import passes Fuuga's check against Laya's own outputs.
- Not yet checked: loading this folder in Laya's own Python code. The files follow what Laya's
loader reads (weights loaded strictly, the encoder built from
encoder/config.json, the act head sized fromact_costs), but no run of Laya's code on this folder has been made.
Limitations and terms
- Fine-tuned on this one question only: Laya's other decision tasks were not measured after training and are likely degraded.
- The weights derive from Laya (convaiinnovations/laya, Apache 2.0) and are released under the same licence, with the changes described above.
- The training data, DAIR Emotion, is for "educational and research purposes only" (its dataset card), so this model is released for research and evaluation. If you use it, cite the dataset: Saravia et al., "CARER: Contextualized Affect Representations for Emotion Recognition", EMNLP 2018.
- Downloads last month
- 11
Model tree for Thoriumi/Fuuga-Laya-emotion-laya
Base model
convaiinnovations/laya