Skip to content

fix: Correct rms_norm_eps type hint from int to float in MistralConfig#44702

Open
LincolnBurrows2017 wants to merge 4 commits intohuggingface:mainfrom
LincolnBurrows2017:fix/mistral-rms-norm-eps-type
Open

fix: Correct rms_norm_eps type hint from int to float in MistralConfig#44702
LincolnBurrows2017 wants to merge 4 commits intohuggingface:mainfrom
LincolnBurrows2017:fix/mistral-rms-norm-eps-type

Conversation

@LincolnBurrows2017
Copy link

What does this PR fix?

The rms_norm_eps parameter in MistralConfig was incorrectly typed as int | None but defaults to 1e-6 which is a float. This parameter is passed to MistralRMSNorm which expects eps: float.

Bug Details

  • Type: Type hint bug
  • Affected: 59+ model configurations in the transformers codebase have the same issue
  • Impact: While Python's duck typing allows this to work at runtime, static type checkers (mypy, pyright) will flag this as incorrect

Example

from transformers import MistralConfig

config = MistralConfig()
# rms_norm_eps is 1e-6 (float), but type hint says int | None
print(type(config.rms_norm_eps))  # float

This is a simple one-line fix that corrects the type annotation.

LincolnBurrows2017 added 4 commits March 13, 2026 20:44
The rms_norm_eps parameter was incorrectly typed as int | None but
defaults to 1e-6 which is a float. This parameter is passed to
MistralRMSNorm which expects eps: float. This is a type hint bug
that affects 59+ model configurations in the codebase.
@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: doge, mistral, qwen2_vl, qwen3_5, qwen3_vl

@github-actions
Copy link
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=44702&sha=550a95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant