Conversation
Summary of ChangesHello, 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 addresses a critical bug in the Highlights
🧠 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request fixes a bug where using a string-based reward function with VisionRLVRWorkflow would cause a crash. The fix correctly adds logic to dynamically import and wrap the reward function. However, this introduces code duplication from the parent RLVRWorkflow class. I've added a suggestion to refactor this duplicated logic to improve maintainability.
| if isinstance(self.reward_fn, str): | ||
| self.reward_fn = import_from_string(self.reward_fn) | ||
| self.async_reward_fn = AsyncRewardWrapper(self.reward_fn) |
There was a problem hiding this comment.
This logic for lazily initializing the reward function is also present in the parent class RLVRWorkflow.arun_episode. This duplication could lead to maintenance issues if the logic needs to be updated in the future.
To improve maintainability and avoid duplication, consider refactoring this block into a protected helper method in the RLVRWorkflow base class and calling it from both arun_episode methods.
For example, you could add the following to areal/workflow/rlvr.py:
class RLVRWorkflow(RolloutWorkflow):
# ...
def _initialize_reward_fn(self):
"""Initializes reward_fn from string if necessary."""
if isinstance(self.reward_fn, str):
self.reward_fn = import_from_string(self.reward_fn)
self.async_reward_fn = AsyncRewardWrapper(self.reward_fn)Then, you could call self._initialize_reward_fn() at the beginning of arun_episode in both RLVRWorkflow and VisionRLVRWorkflow, which would remove the duplicated code.
|
This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days. Please add a comment or push new commits to keep it active. Thank you for your contribution! |
Description
The current ascend branch raises error when training VLMs. The error comes from the import str reward in
areal/workflow/vision_rlvr.py. This PR fixes this issue.Type of Change
work as expected)
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
Additional Context
Need help? Check the Contributing Guide or ask in
GitHub Discussions!