Skip to content

Conversation

@albertvillanova
Copy link
Member

@albertvillanova albertvillanova commented Sep 15, 2025

Add deprecation warnings to docstrings.

This PR adds deprecation notices to docstrings for documentation consistency: the docstring should match the actual behavior of the code.

This approach is better than removing it entirely because:

  • The parameter still exists in the code and will accept values (even if it shows a warning)
  • Users need the documentation of the parameter to better understand the deprecation message
@albertvillanova albertvillanova marked this pull request as draft September 15, 2025 08:52
@HuggingFaceDocBuilderDev

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.

@albertvillanova albertvillanova marked this pull request as ready for review September 15, 2025 09:18
@albertvillanova
Copy link
Member Author

Screenshot from 2025-09-15 11-35-48
@qgallouedec
Copy link
Member

Screenshot 2025-09-15 at 8 50 52 AM

for rloo it's not properly rendered

@albertvillanova
Copy link
Member Author

albertvillanova commented Sep 16, 2025

for rloo it's not properly rendered

Yes, I discovered this bug in doc-builder: the warning is not properly rendered when the parameter description is under a parameter subsection > Deprecated parameters.

  • For the rest of classes, I just put the deprecated params under no subsection, just at the root parameters section Args:
  • But for RLOOConfig:
    • There already exist other param subsections:
      Parameters:
          > Parameters that control the model and reference model
      
          model_init_kwargs (`str`, `dict[str, Any]`, *optional*):
    • Therefore the possible solutions are:
      • Either fix the rendering by putting the deprecated parameters in the root Args section, before all the rest of parameters: but I don't think it makes sense to document the deprecated parameters before the functional ones
      • Or put the deprecated parameters in a > Deprecated parameters subsection after all the other params, with their malformed rendering
        • I could open an issue (or PR) in doc-builder and eventually have these parameters properly rendered

What do you think?

@albertvillanova
Copy link
Member Author

Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Copy link
Member

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

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

lgtm!

@qgallouedec
Copy link
Member

I mean, let's keep the malformed warning, not a big deal

@albertvillanova albertvillanova merged commit 6356343 into huggingface:main Sep 17, 2025
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants