transformers
39f751a5 - :rotating_light: Validate config attributes (#41250)

Commit
8 days ago
:rotating_light: Validate config attributes (#41250) * initial commit * just push for now * maybe not do it for all models, lets see how many models fail now * update * lets see what esle fails now * nit * style * delete rope validation * bart * make style * provate rope valid for now, hub complains * more updates * i love backwards compatibility! Let's check if this will work with remote code, tmrw * pin hf hub 1.4.0 * want to check tests * why do we even keep `use_return_dict` from 6 hyear ago? * special eos token can be a list in many cases, fix type hints * batch * batch * batch * another small batch * more * more models * batch * batch * annoying typings * batch * batch * batch * last batch * fix repo * fix some * many many fixes * fix more * commit a small batch of fixes * more fixes * fix repo and the new model * clean up config files from unused imports * revert ths one * more new models in main branch * let dropouts be float AND int, who know what we have in the hub! * fix a few more non-modeling tests * roep validation is now part of hub strict * oops * rope and text config * when does this end? * comment out for now * oke, now donw i think * dropout can be int in saved ckpt, fix again * fox repo again * processor tests * nit * remove `| None` in typing when not needed! * fix style * new models * subconfig is a cls attr * fix some tests * cosmetic stuff * . * fix repo * the test * please be fixed! * this time is the real final fix. before merging docs * fix style * fix repo * why auto-doc can't resolve inheritance and just copy??? * fix some tests * fix the auto-docstring * oh pls! * lastc fix * repr is false by default * check docstring attr * fix slow CI * fix repo * fix style and copies after rebase * pin 1.5.0 * init subclass doesn't help with dataclass decorator, revert * style * regex replace doesn't always just work, fix! * Fix incorrect default values in config dataclass migration (PR #41250) Fixes the following bugs introduced during the __init__ → @dataclass conversion: - cvt: embed_dim (4, 192, 384) → (64, 192, 384) (typo: 64 became 4) - univnet: resblock_dilation_sizes last element 2 → 27 (typo) - fsmt: max_position_embeddings 104 → 1024 (typo: missing digit) - qwen3_5: num_key_value_heads 2 → 4 (lost override of parent default) - afmoe: route_scale 10.0 → 1.0 - granitemoeshared: router_aux_loss_coef 0.01 → 0.001 - bridgetower: initializer_factor 1e-10 → 1 (all 3 config classes) - llama, aria, jais2, higgs_audio_v2, olmo_hybrid: initializer_range default 0.2 → 0.02 in interval() validator - video_llama_3: restore missing initializer_range = 0.02 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Fix 3 more config default regressions (round 2) - autoformer: restore scaling default to True (was changed to 'std', but True means 'mean' scaling per modeling code - different behavior) - higgs_audio_v2: restore rms_norm_eps to 1e-5 (was 1e-6 inherited from LlamaConfig; override explicitly in modular + generated) - higgs_audio_v2_tokenizer: restore target_bandwidths default to [0.5, 1, 1.5, 2] (was [0.5, 1, 1.5, 2, 4] inherited from XcodecConfig) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Fix check-repo: regenerate higgs_audio_v2_tokenizer from modular The modular conversion check was failing because the generated configuration_higgs_audio_v2_tokenizer.py didn't match the modular. Regenerated the file and let the linter normalize the type annotations to be consistent with the parent XcodecConfig. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * higgs nit? * fix higgs * style * new models * xcodec is same as higgs, fix * forogt * love it when modular complains about newline * fix new models' typing hints * oops, that is a property * and one more new model just merged * actually, non-dataclass child is really not the way so * dont' replace all matches! * Apply repo consistency fixes * Revert "Apply repo consistency fixes" This reverts commit 125624aed6813ad194f6511e479b4000d553350c. * fix repo, would be great to fix this in `style` * why I cant fix all failures from repo at once --------- Co-authored-by: Arthur <arthur.zucker@gmail.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Author
Parents
Loading