Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ Example:
"The `Trainer.foo` method is deprecated and will be removed in version 0.14.0. "
"Please use the `Trainer.bar` class instead.",
FutureWarning,
stacklevel=2,
)
```

Expand Down
3 changes: 2 additions & 1 deletion trl/experimental/bco/bco_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ def __init__(
"This trainer will soon be moved to trl.experimental and is a candidate for removal. If you rely on "
"it and want it to remain, please share your comments here: "
"https://github.com/huggingface/trl/issues/4223. Silence this warning by setting environment variable "
"TRL_EXPERIMENTAL_SILENCE=1."
"TRL_EXPERIMENTAL_SILENCE=1.",
stacklevel=2,
)
if embedding_func is not None and not (is_sklearn_available() and is_joblib_available()):
raise ImportError(
Expand Down
3 changes: 2 additions & 1 deletion trl/experimental/gold/gold_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,8 @@ def tokenize_with_original_text(example, processing_class, dataset_text_field, a
warnings.warn(
"Mismatch between tokenized prompt and the start of tokenized prompt+completion. "
"This may be due to unexpected tokenizer behavior, whitespace issues, or special "
"token handling. Verify that the tokenizer is processing text consistently."
"token handling. Verify that the tokenizer is processing text consistently.",
stacklevel=2,
)

# Create a completion mask
Expand Down
1 change: 1 addition & 0 deletions trl/experimental/online_dpo/online_dpo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,5 @@ def __post_init__(self):
f"The configuration has `max_new_tokens` ({self.max_new_tokens}) >= `max_length` ({self.max_length}). "
"This will cause prompts to be truncated or completely removed in the forward pass. "
"To preserve prompts, ensure e.g. `max_length > max_new_tokens + 512`. ",
stacklevel=2,
)
2 changes: 1 addition & 1 deletion trl/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def is_vllm_available() -> bool:
warnings.warn(
f"TRL currently only supports vLLM version `0.10.2`. You have version {_vllm_version} installed. We "
"recommend to install this version to avoid compatibility issues.",
UserWarning,
stacklevel=2,
)
return _vllm_available

Expand Down
1 change: 1 addition & 0 deletions trl/trainer/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ def __init__(self, *args, **kwargs):
"`from trl.experimental.merge_model_callback import MergeModelCallback`. The current import path will be "
"removed and no longer supported in TRL 0.27. For more information, see "
"https://github.com/huggingface/trl/issues/4223.",
stacklevel=2,
)


Expand Down
3 changes: 2 additions & 1 deletion trl/trainer/kto_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ def __init__(
"This trainer will soon be moved to trl.experimental and is a candidate for removal. If you rely on "
"it and want it to remain, please share your comments here: "
"https://github.com/huggingface/trl/issues/4223. Silence this warning by setting environment variable "
"TRL_EXPERIMENTAL_SILENCE=1."
"TRL_EXPERIMENTAL_SILENCE=1.",
stacklevel=2,
)
if type(args) is TrainingArguments:
raise ValueError("Please use `KTOConfig` instead TrainingArguments.")
Expand Down
1 change: 1 addition & 0 deletions trl/trainer/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def __post_init__(self):
warnings.warn(
"`torch_dtype` is deprecated and will be removed in version 0.27.0, please use `dtype` instead.",
FutureWarning,
stacklevel=2,
)
self.dtype = self.torch_dtype

Expand Down
3 changes: 2 additions & 1 deletion trl/trainer/rloo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ def __init__(
"This trainer will soon be moved to trl.experimental and is a candidate for removal. If you rely on "
"it and want it to remain, please share your comments here: "
"https://github.com/huggingface/trl/issues/4223. Silence this warning by setting environment variable "
"TRL_EXPERIMENTAL_SILENCE=1."
"TRL_EXPERIMENTAL_SILENCE=1.",
stacklevel=2,
)

# Args
Expand Down
1 change: 1 addition & 0 deletions trl/trainer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def __init__(self, *args, **kwargs) -> None:
"The `RewardDataCollatorWithPadding` is deprecated and will be removed in version 0.27.0. Please use "
"`trl.trainer.reward_trainer.DataCollatorForPreference` instead.",
FutureWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)

Expand Down
Loading