ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

新版本的kto无效

Open rtz1998 opened this issue 2 years ago • 2 comments

  1. 报错'KTOTrainer' object has no attribute 'calculate_KL'

  2. desirable_weight设置无效 /usr/local/lib/python3.10/dist-packages/swift/trainers/rlhf_trainer/kto_trainer.py:81: UserWarning:

         You have different amounts of desirable/positive and undesirable/negative examples but the
    
         weights on the desirable and undesirable losses don't seem to be in an ideal range. Based
    
         on your data, we recommend EITHER desirable_weight in [0.42, '0.56]
    
         or undesirable_weight in [1.8, 2.39] (but NOT BOTH).
    
         See the documentation on how to optimally set these weights.
    

warnings.warn(

rtz1998 avatar Sep 29 '24 10:09 rtz1998

Please use trl==0.10.* first, we will soon be compatible with trl==0.11.*

Jintao-Huang avatar Sep 29 '24 12:09 Jintao-Huang

还是有第一个问题,脚本里设置了undesirable_weight,但是设置无效。 /code/llm_env/lib/python3.10/site-packages/swift/trainers/rlhf_trainer/kto_trainer.py:81: UserWarning:

        You have different amounts of desirable/positive and undesirable/negative examples but the

        weights on the desirable and undesirable losses don't seem to be in an ideal range. Based

        on your data, we recommend EITHER desirable_weight in [0.42, '0.56]

        or undesirable_weight in [1.8, 2.39] (but NOT BOTH).

        See the documentation on how to optimally set these weights.

rtz1998 avatar Oct 11 '24 10:10 rtz1998