Skip to content

Fix inconsistent docstrings, missing arguments, and typos in models#2580

Open
AlejandroPG06 wants to merge 2 commits intokeras-team:masterfrom
AlejandroPG06:master
Open

Fix inconsistent docstrings, missing arguments, and typos in models#2580
AlejandroPG06 wants to merge 2 commits intokeras-team:masterfrom
AlejandroPG06:master

Conversation

@AlejandroPG06
Copy link

@AlejandroPG06 AlejandroPG06 commented Feb 5, 2026

This PR addresses several documentation inconsistencies and typographical errors across the src/models directory. It ensures that docstrings accurately reflect the init arguments and fixes common typos in comments and error messages.

Changes

  1. Docstring Completeness
    MistralBackbone: Added documentation for the dropout argument.
    FluxBackbone: Added documentation for missing shape arguments (image_shape, text_shape, image_ids_shape, text_ids_shape, y_shape).

  2. Code Example Fixes
    PaliGemmaBackbone: Corrected images_size to image_size in the class docstring example to match the actual argument name.

  3. Typo Fixes
    Fixed roatary $\to$ rotary in GPT-OSS, Llama3, and Mixtral backbones.
    Fixed traingular $\to$ triangular in Mixtral decoder.
    Fixed Polling $\to$ Pooling in error messages for HGNetV2, VGG, and ImageClassifier (prevents confusing error messages for users).
    Fixed done a float32 $\to$ done in float32 in ~14 files (CLIP, SigLIP, PaliGemma, Dino, etc.).
    Fixed value user for $\to$ value used for in Gemma models.
    Fixed minor typos like fucntion $\to$ function and polling $\to$ pooling.
    Verification
    Verified that the updated docstrings match the function signatures.
    Checked that no logic code was altered, only comments, docstrings, and error message strings.

Fixes #2579

@google-cla
Copy link

google-cla bot commented Feb 5, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the Gemma Gemma model specific issues label Feb 5, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AlejandroPG06, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the clarity and accuracy of the codebase by resolving various documentation inconsistencies and typographical errors within the src/models directory. The changes primarily involve updating docstrings to correctly reflect function arguments, fixing code examples, and correcting common spelling mistakes in comments and error messages. The overall impact is improved readability, maintainability, and a more consistent user experience for developers interacting with these models, without altering any core logic.

Highlights

  • Docstring Completeness: Added missing documentation for the dropout argument in MistralBackbone and for several shape-related arguments (image_shape, text_shape, image_ids_shape, text_ids_shape, y_shape) in FluxBackbone.
  • Code Example Correction: Corrected an inconsistency in the PaliGemmaBackbone class docstring example, changing images_size to image_size to align with the actual argument name.
  • Typographical Error Corrections: Addressed numerous typos across various model files, including 'roatary' to 'rotary' (GPT-OSS, Llama3, Mixtral), 'traingular' to 'triangular' (Mixtral decoder), 'Polling' to 'Pooling' in error messages (HGNetV2, VGG, ImageClassifier), 'done a float32' to 'done in float32' (across ~14 files like CLIP, SigLIP, PaliGemma, Dino), 'value user for' to 'value used for' (Gemma models), and other minor spelling mistakes like 'fucntion' to 'function'.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • keras_hub/src/models/clip/clip_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/clip/clip_text_encoder.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/clip/clip_vision_encoder.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/depth_anything/depth_anything_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/dinov2/dinov2_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/dinov3/dinov3_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/flux/flux_model.py
    • Added docstrings for missing arguments: image_shape, text_shape, image_ids_shape, text_ids_shape, and y_shape.
  • keras_hub/src/models/gemma/gemma_backbone.py
    • Fixed typo: 'value user for' changed to 'value used for'.
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/gemma3/gemma3_backbone.py
    • Fixed typo: 'value user for' changed to 'value used for'.
  • keras_hub/src/models/gemma3/gemma3_vision_encoder.py
    • Fixed typo: 'value user for' changed to 'value used for'.
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/gpt2/gpt2_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/gpt_oss/gpt_oss_backbone.py
    • Fixed typo: 'roatary' changed to 'rotary'.
  • keras_hub/src/models/hgnetv2/hgnetv2_image_classifier.py
    • Fixed typo in error message: 'Polling' changed to 'Pooling'.
  • keras_hub/src/models/image_classifier.py
    • Fixed typo in error message: 'Polling' changed to 'Pooling'.
  • keras_hub/src/models/llama3/llama3_backbone.py
    • Fixed typo: 'roatary' changed to 'rotary'.
  • keras_hub/src/models/mistral/mistral_backbone.py
    • Fixed typo: 'roatary' changed to 'rotary'.
    • Added docstring for the dropout argument.
  • keras_hub/src/models/mistral/mistral_transformer_decoder.py
    • Fixed typo: 'traingular' changed to 'triangular'.
  • keras_hub/src/models/mixtral/mixtral_backbone.py
    • Fixed typo: 'roatary' changed to 'rotary'.
  • keras_hub/src/models/mixtral/mixtral_decoder.py
    • Fixed typo: 'traingular' changed to 'triangular'.
  • keras_hub/src/models/pali_gemma/pali_gemma_backbone.py
    • Fixed typo: 'polling' changed to 'pooling'.
    • Fixed typo: 'value user for' changed to 'value used for'.
    • Fixed typo: 'done a float32' changed to 'done in float32'.
    • Corrected example usage: images_size changed to image_size.
  • keras_hub/src/models/pali_gemma/pali_gemma_vit.py
    • Fixed typo: 'polling' changed to 'pooling'.
    • Fixed typo: 'fucntion' changed to 'function'.
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/siglip/siglip_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/siglip/siglip_text_encoder.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/siglip/siglip_vision_encoder.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_backbone.py
    • Fixed typo: 'done a float32' changed to 'done in float32'.
  • keras_hub/src/models/vgg/vgg_image_classifier.py
    • Fixed typo in error message: 'Polling' changed to 'Pooling'.
Activity
  • No human activity has been recorded on this pull request since its creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request provides a valuable set of fixes for documentation across various models. The changes correctly address typos in docstrings, comments, and error messages, and also add missing argument documentation to ensure consistency with the function signatures. The correction in the PaliGemmaBackbone code example is also accurate. All the changes are correct and improve the overall quality and clarity of the codebase. The pull request is good to merge.

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

Labels

Gemma Gemma model specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Inconsistent docstrings, missing arguments, and typos in models/

1 participant