Skip to content

Conversation

@qgallouedec
Copy link
Member

@qgallouedec qgallouedec commented Nov 6, 2025

Just improve codebase consistency wrt relative imports

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR converts absolute imports to relative imports across multiple files in the TRL library. The changes improve import consistency by using relative paths instead of absolute trl.* imports.

Key changes:

  • Standardizes import style from absolute to relative imports
  • Maintains proper relative path depth based on module location
  • Consolidates multi-line imports in one file to single-line format

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
trl/trainer/nash_md_config.py Changed import from trl.trainer.online_dpo_config to relative import .online_dpo_config
trl/rewards/accuracy_rewards.py Changed import from trl.import_utils to relative import ..import_utils
trl/mergekit_utils.py Changed import from trl.import_utils to relative import .import_utils
trl/experimental/gspo_token/grpo_trainer.py Changed import from trl to relative import ...trainer.grpo_trainer and removed blank line
trl/experimental/grpo_with_replay_buffer/grpo_with_replay_buffer_trainer.py Changed multi-line imports from trl.data_utils and trl.trainer to single-line relative imports using ...
trl/experimental/grpo_with_replay_buffer/grpo_with_replay_buffer_config.py Changed import from trl.trainer.grpo_config to relative import ...trainer.grpo_config

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

Thanks.

@qgallouedec qgallouedec merged commit aaed6c1 into main Nov 8, 2025
13 checks passed
@qgallouedec qgallouedec deleted the relative-imports branch November 8, 2025 15:20
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.

4 participants