Repository navigation
Developer experience: bundled recipes, safe defaults, Python training API, server batching - #4
Merged
Merged
Conversation
… API, server batching - Recipes ship in the package (src/decisionformer/recipes): train, config and adapt accept a recipe name; decisionformer recipes lists them and decisionformer init copies one to edit. Configs can inherit a recipe. - configs/base.yaml is gone: its values are the code defaults (resumable state and evaluation every 500 steps, resume auto, max_length 1024); the learning rate follows the fine-tuning mode. Resumable state is removed when a run finishes, and rerunning a finished run warns first. - decisionformer.train() takes a recipe name, a YAML file or a dict, with dotted overrides; load_config accepts the same. - New starting recipe deciformer15k_qwen3 (Qwen3-0.6B + LoRA): 0.824 dev accuracy on deciformer-15k in one epoch. The Qwen3.5 recipe is removed until Qwen3.5 fine-tuning learns reliably (docs/benchmarks.md). - predict reads every accepted record shape, batches requests and reports records it cannot answer as error lines instead of crashing. - serve batches requests that arrive while the model is busy (--max-batch) and documents the request and response schemas at /docs. - Logs: Hub request lines are silenced, precision is named, and training steps show progress and the time left. Training warns about overlap between the training data and the evaluation or calibration data. - Local run exports answer with their run name instead of best/last. - CLI help shows examples and the recipes; the README installs from GitHub until the first PyPI release.
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.
Fixes from a first-time-user review: install from pip in an empty folder, then follow the README.
Blockers fixed
decisionformer train deciformer15k_qwen3works after a plain pip install; before,configs/recipes/...only existed in a clone. Related commands:decisionformer recipeslists the recipes.decisionformer init NAMEcopies one to edit.base: NAME.deciformer15k_qwen3(Qwen3-0.6B + LoRA) replaces the Qwen3.5 example, which has not learned reliably. The Qwen3.5 recipe is removed until it does; details are indocs/benchmarks.md.predictreads every accepted record shape: requests, single questions and flat rows such as deciformer-15k. It batches requests, and a record it can't answer becomes an error line instead of crashing the run.Friction fixed
configs/base.yamlis gone and its values are now the code defaults:resume: autoandmax_length1024.decisionformer.train(...)takes a recipe name, a YAML file or a dict, plus dotted overrides.load_configaccepts the same.httpx2request lines are silenced.step N/totaland the time left.--max-batch(default 16); a single request still runs alone./docsnow shows the request and response schemas.runs/<name>/bestanswers as<name>, notbest.Testing
All on the GPU box; nothing was run on a laptop.
recipes/init,predictwith mixed shapes and a bad row, server batching with error isolation, the/docsschema, the leakage warning,train()from Python, and the state cleanup after pause/resume.recipes,init,data split,train local_smollm2(3 steps),predict(3 rows plus a bad one),serve,/docs, and 32 requests from 16 concurrent clients all work. The training log has nohttpxlines.deciformer15k_qwen3, one epoch on the RTX 2060 SUPER (fp16 fallback): dev accuracy 0.792 → 0.805 → 0.824 at steps 125/250/375, calibrated ECE 0.023, per task 0.75–0.90.Not in this PR