Skip to content

Conversation

@chenyushuo
Copy link
Collaborator

Description

As the title says.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chenyushuo, 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 a significant new capability to the 'trinity' launcher by adding a 'convert' mode. This mode allows users to transform existing model checkpoints into the widely-used Hugging Face format, enhancing interoperability and ease of model sharing within the deep learning ecosystem. The change includes a robust 'Converter' class to handle various checkpoint types and integrates this functionality directly into the command-line interface.

Highlights

  • New 'convert' mode: A new command-line mode, 'convert', has been added to the 'trinity' launcher for checkpoint conversion.
  • Hugging Face format conversion: This new mode facilitates the conversion of model checkpoints into the Hugging Face format, enhancing interoperability.
  • Flexible conversion logic: A dedicated 'Converter' class is introduced to manage the conversion process, supporting both Megatron and FSDP checkpoint types.
  • Testing for conversion: The trainer tests have been updated to include a test case that verifies the functionality of the new 'convert' mode, ensuring 'model.safetensors' are correctly generated.
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 introduces a new convert mode to the launcher, which allows converting saved checkpoints to the Hugging Face format. The implementation includes a Converter class that handles the logic for different checkpoint types (Megatron, FSDP) and is recursive to process all checkpoints in a directory. The changes are accompanied by a test case that verifies the conversion process.

My main feedback is on improving the error handling. The new code uses broad except Exception blocks in a few places. While sometimes necessary, silently catching exceptions can make debugging difficult. I've suggested adding logging to these blocks to provide more context when errors occur.

Overall, this is a useful addition and the implementation is solid.

@chenyushuo
Copy link
Collaborator Author

/unittest-module-trainer

@chenyushuo
Copy link
Collaborator Author

/unittest-module-trainer

1 similar comment
@pan-x-c
Copy link
Collaborator

pan-x-c commented Jan 20, 2026

/unittest-module-trainer

@chenyushuo
Copy link
Collaborator Author

/unittest-module-algorithm

@pan-x-c pan-x-c merged commit 9eb1244 into agentscope-ai:main Jan 20, 2026
2 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.

2 participants