Repository navigation
Support custom-code backbones (Nandi, Lumma) and training on from decisionformer - #11
Open
Rohit7sali wants to merge 1 commit into
Open
Rohit7sali wants to merge 1 commit into
Rohit7sali wants to merge 1 commit into
Conversation
…ision checkpoints
This branch has not been deployed
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.
Support custom-code backbones (Nandi, Lumma) and training on from decision checkpoints
Adds inference and fine-tuning for FrontiersMind's models:
trust_remote_code=True/--trust-remote-codemodel.trust_remote_code: trueChanges
trust_remote_codeend to end: new--trust-remote-codeflag oneval/predict/serve; LoRA merge passes the flag along; exports copy the model's.pyfiles andauto_map, so checkpoints load on their own. Loading without the flag fails with a message that names it.data.prompt.plain:auto|decisionformer|lumma):<bos>+ prompt +\n\nAnswer:, tokenized with the fast tokenizer so the customencode()cannot add a second BOS.autopickslummafor Nandi/Lumma model types; the choice is saved asplain_promptindecision_config.json. Other models keep the existing prompt byte for byte.lm_head_proj, so it reproduces the base model's code-token logits at step 0.model.backbonehas adecision_config.json, its readout seeds thecode_readouthead, and its prompt, attention mode and codes carry over unless set in the config. Adapter-only checkpoints are refused with a clear message.encodeoverrides).nandi_mini,lumma_base(LoRA),lumma_fev_continue.Tests
tests/test_custom_models.py: 18 offline tests on a tiny custom-code model built like Nandi/Lumma (factorized embedding,lm_head_proj, BOS-prepending tokenizer). They cover the exact prompt tokens, readout = LM-head logits, train → export → reload, LoRA merge, the refusal without the flag, training on from a 4B/27B-v2-style and a 0.1B-v2-style checkpoint (identical outputs at step 0), the CLI flag and the recipes.tests/test_hub_models.py: real checkpoints, opt in withDECISIONFORMER_HUB_TESTS=1(DECISIONFORMER_HUB_LARGE=1adds 4B/27B-v2 on a GPU). On an RTX 3060: 8 passed, 1 skipped (thelumma-fevpackage comparison, skipped when the package is not installed; it passed in a local run), 27B not run. Includes Lumma-fev-0.1B-v2 matching an independent re-implementation of the lumma-fev runtime, Nandi / Lumma base fine-tuning, and Lumma-fev-4B-v2 load + LoRA training.train nandi_mini→eval --trust-remote-code(reproduces the training-time accuracy exactly) →serve --trust-remote-codeanswers/v1/systemone.train local_smollm2→evalunchanged for standard models.gemma2-sdpafailures intests/test_attention.pyalso fail onmainsince transformers 5.21 (Gemma2 no longer accepts SDPA); they will be fixed in a separate PR.