Skip to content

Conversation

@james77777778
Copy link
Collaborator

Description of the change

This PR adds the detailed Gemini CLI instructions for implementing DINOV3:
#2444

I'm unsure about the location for this guideline. Let me know if you suggest placing it elsewhere.

cc @divyashreepathihalli

Reference

Colab Notebook

Checklist

  • I have added all the necessary unit tests for my change.
  • I have verified that my change does not break existing code and works with all backends (TensorFlow, JAX, and PyTorch).
  • My PR is based on the latest changes of the main branch (if unsure, rebase the code).
  • I have followed the Keras Hub Model contribution guidelines in making these changes.
  • I have followed the Keras Hub API design guidelines in making these changes.
  • I have signed the Contributor License Agreement.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @james77777778, 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 introduces comprehensive guidelines to the CONTRIBUTING.md file, outlining a workflow for leveraging the Gemini CLI to streamline the process of adding new models to Keras Hub. It provides a practical, step-by-step example using the DINOV3 model, covering everything from initial setup and model generation to numerical validation and the creation of necessary conversion scripts and unit tests. The aim is to accelerate development and standardize the integration of new models.

Highlights

  • New Gemini CLI Workflow: A comprehensive new section has been added to CONTRIBUTING.md detailing how to co-work with the Gemini CLI to accelerate model development.
  • DINOV3 Implementation Example: The new workflow includes a step-by-step guide using DINOV3Backbone as a concrete example, covering model generation, numerical validation, and the creation of conversion and unit test scripts.
  • Detailed CLI Instructions: Instructions are provided for Gemini CLI installation, project initialization, instructing the CLI to add models, create validation scripts, run scripts, and generate conversion/test files.
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 adds valuable documentation to CONTRIBUTING.md on how to use the Gemini CLI for model development within Keras Hub. The instructions are clear and provide a concrete example with DINOV3. My review includes a couple of suggestions to better align the new workflow with the existing contribution guidelines in the STYLE_GUIDE.md, specifically regarding the required validation artifacts and script naming conventions.

Comment on lines +270 to +284
Next, let's instruct the CLI to construct a numerical validation test to ensure the implementation is correct. Before running this step, make sure you have installed the `transformers` library and have access to the `facebook/dinov3-*` presets.

```shell
# In the CLI.
Create a numerical validation script `check_dinov3.py` for `DINOV3Backbone` at project root. Use the HF preset `facebook/dinov3-vits16-pretrain-lvd1689m` as a reference for the expected outputs. Remember to port the weights from HF to `DINOV3Backbone` within the script and refer to the existing implementation here: @keras_hub/src/utils/transformers/convert_dinov2.py
```

Now, instruct the CLI to run the script and correct any errors. If you are working within Conda environments, be sure to also instruct the CLI to use the appropriate environment for execution.

```shell
# In the CLI.
Run @check_dinov3.py by `KERAS_BACKEND=jax conda run -n keras-hub-jax python check_dinov3.py`. Fix any errors encountered during execution.
```

During this phase, human intervention is often necessary. You will need to carefully review the CLI's modifications and provide guidance or even handcraft some details that the tool failed to implement correctly.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The workflow describes creating a Python script (check_dinov3.py) for numerical validation. While this is a useful step for development, the project's contribution guidelines require a Colab notebook demonstrating numerical equivalence for pull requests.1 Please consider adding a note to clarify that this script is a development tool and that a Colab notebook is the required final artifact for the PR. This will help contributors submit complete pull requests.

Style Guide References

Footnotes

  1. The style guide mandates that every pull request must include Colab notebooks for numerical validation against the original model.

@james77777778 james77777778 force-pushed the add-coworking-gemini-cli branch from eb9e571 to ac30d60 Compare October 30, 2025 12:19
@divyashreepathihalli divyashreepathihalli merged commit c7bd26d into keras-team:master Oct 30, 2025
8 checks passed
@james77777778 james77777778 deleted the add-coworking-gemini-cli branch October 31, 2025 03:38
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.

2 participants