Skip to content

Fix type for teacher_model_init_kwargs when passed as CLI JSON string#5258

Merged
albertvillanova merged 2 commits into
huggingface:mainfrom
albertvillanova:fu-5230
Mar 11, 2026
Merged

Fix type for teacher_model_init_kwargs when passed as CLI JSON string#5258
albertvillanova merged 2 commits into
huggingface:mainfrom
albertvillanova:fu-5230

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Mar 10, 2026

Copy link
Copy Markdown
Member

Fix type for teacher_model_init_kwargs when passed as CLI JSON string.

  • As documented in transformers

This PR fixes the type annotation for the teacher_model_init_kwargs field across multiple configuration classes in the codebase. The change expands the allowed types to include str in addition to dict[str, Any] and None, taking into account how teacher model initialization arguments can be provided via CLI JSON string.

Follow-up to:

  • Config class updates:
    • GKDConfig, GOLDConfig, and MiniLLMConfig: Updated the type annotation for teacher_model_init_kwargs to accept dict[str, Any], str, or None instead of just dict[str, Any] or None.

Note

Low Risk
Type-annotation-only change in config classes; behavior should be unchanged aside from improving compatibility with CLI-provided JSON strings.

Overview
Updates experimental trainer config dataclasses (GKDConfig, GOLDConfig, MiniLLMConfig) to widen the type of teacher_model_init_kwargs from dict[str, Any] | None to dict[str, Any] | str | None, matching transformers behavior when the value is provided as a CLI JSON string.

Written by Cursor Bugbot for commit d934224. This will update automatically on new commits. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread trl/experimental/minillm/minillm_config.py
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@qgallouedec qgallouedec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@albertvillanova albertvillanova merged commit 179108b into huggingface:main Mar 11, 2026
4 checks passed
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.

3 participants