mirror of
https://github.com/huggingface/trl.git
synced 2025-10-20 10:03:51 +08:00
Deprecate BestOfNSampler
(#4291)
Co-authored-by: behroozazarkhalili <ermiaazarkhalili> Co-authored-by: Behrooz Azarkhalili <80390531+behroozazarkhalili@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
31caf64778
commit
19d2f97932
@ -1,5 +1,8 @@
|
||||
# Best of N sampling: Alternative ways to get better model output without RL based fine-tuning
|
||||
|
||||
> [!WARNING]
|
||||
> Best-of-N sampling is deprecated and will be removed in TRL 0.25.0.
|
||||
|
||||
Within the extras module is the `best-of-n` sampler class that serves as an alternative method of generating better model output.
|
||||
As to how it fares against the RL based fine-tuning, please look in the `examples` directory for a comparison example
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import warnings
|
||||
from typing import Any, Callable, Optional, Union
|
||||
|
||||
import torch
|
||||
@ -42,8 +43,16 @@ class BestOfNSampler:
|
||||
generation_config ([`~transformers.GenerationConfig`], *optional*):
|
||||
Generation config passed to the underlying model's `generate` method. See
|
||||
[`~transformers.GenerationConfig`] for more details.
|
||||
|
||||
<Deprecated version="0.24.0">
|
||||
|
||||
`BestOfNSampler` is deprecated and will be removed in version 0.25.
|
||||
|
||||
</Deprecated>
|
||||
"""
|
||||
|
||||
warnings.warn("`BestOfNSampler` is deprecated and will be removed in TRL 0.25.", FutureWarning, stacklevel=2)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
model: PreTrainedModelWrapper,
|
||||
|
Reference in New Issue
Block a user