Skip to content

Commit aaed6c1

Browse files
authored
Consistency regarding relative imports (#4498)
1 parent 20760ba commit aaed6c1

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

trl/experimental/grpo_with_replay_buffer/grpo_with_replay_buffer_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from dataclasses import dataclass, field
1616

17-
from trl.trainer.grpo_config import GRPOConfig
17+
from ...trainer.grpo_config import GRPOConfig
1818

1919

2020
@dataclass

trl/experimental/grpo_with_replay_buffer/grpo_with_replay_buffer_trainer.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@
1818
import torch
1919
from accelerate.utils import gather_object
2020

21-
from trl.data_utils import (
22-
apply_chat_template,
23-
is_conversational,
24-
prepare_multimodal_messages,
25-
)
26-
from trl.trainer.grpo_trainer import GRPOTrainer
27-
from trl.trainer.utils import nanmax, nanmin, nanstd, pad
28-
21+
from ...data_utils import apply_chat_template, is_conversational, prepare_multimodal_messages
22+
from ...trainer.grpo_trainer import GRPOTrainer
23+
from ...trainer.utils import nanmax, nanmin, nanstd, pad
2924
from .grpo_with_replay_buffer_config import GRPOWithReplayBufferConfig
3025

3126

trl/experimental/gspo_token/grpo_trainer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
import torch
1616

17-
from trl import GRPOTrainer as _GRPOTrainer
18-
17+
from ...trainer.grpo_trainer import GRPOTrainer as _GRPOTrainer
1918
from ...trainer.utils import nanmax, nanmin
2019

2120

trl/mergekit_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import torch
1616
from huggingface_hub import HfApi
1717

18-
from trl.import_utils import is_mergekit_available
18+
from .import_utils import is_mergekit_available
1919

2020

2121
if is_mergekit_available():

trl/rewards/accuracy_rewards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from trl.import_utils import is_math_verify_available
15+
from ..import_utils import is_math_verify_available
1616

1717

1818
if is_math_verify_available():

trl/trainer/nash_md_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from dataclasses import dataclass, field
1616

17-
from trl.trainer.online_dpo_config import OnlineDPOConfig
17+
from .online_dpo_config import OnlineDPOConfig
1818

1919

2020
@dataclass

0 commit comments

Comments
 (0)