Repository navigation
CI check for NandhaKishorM/laya#899 (do not merge) - #1
Open
GuilhermeFusari wants to merge 1 commit into
Open
GuilhermeFusari wants to merge 1 commit into
GuilhermeFusari wants to merge 1 commit into
Conversation
…d scripts to share The training loop lives in three drifting copies (the Kaggle notebook, the MPS script and research/scripts/finetune_single_device.py). This adds it to the package once, as the first step of NandhaKishorM#887. TrainConfig() trains the way the published notebook does: loss="rlcd", options in their listed order, and an effective batch of 64 (micro_batch=8 x grad_accum=8). - loss="soft-ce" trains on the soft cross-entropy alone (the variant NandhaKishorM#741 tested). - shuffle_options re-encodes items of the named types with a random option_order each epoch, through the same path inference uses, and permutes the target to match. Off by default. - Questions go through Agent._check_question and Agent._to_internal, so training sees the option text inference shows (list-form choices, custom noul labels, non-string instructions). - Calibration uses laya.calibrate.fit_temperature_map, so the fit follows the runtime clamp and buckets; an inherited temperature_by_options is dropped unless refitted. - Questions that cannot be trained on are skipped and counted by reason (invalid_question, invalid_target, target_mismatch, options_collapsed per NandhaKishorM#538). - The max_len / head_max_len used in training are written into the saved config, with the TrainConfig under training.laya_train. - freeze_encoder trains the head only and keeps the encoder in eval mode. The existing scripts are left untouched in this change; NandhaKishorM#851 and NandhaKishorM#885 are open against them. tests/test_train.py is weight-free (one-layer BERT, word-level tokenizer, no downloads) and is registered in the shared suite list and the Windows CI loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| cls.tok = make_tokenizer() | ||
| make_checkpoint(cls.root / "base", cls.tok) | ||
| cls.data = cls.root / "train.jsonl" | ||
| cls.data.write_text("\n".join(json.dumps(r) for r in rows()), encoding="utf-8") |
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.
Runs the repository's CI on the branch of NandhaKishorM#899 inside this fork, because workflows on the upstream PR wait for maintainer approval. Not meant to be merged.