allenai / reward-bench

RewardBench: the first evaluation tool for reward models.
https://huggingface.co/spaces/allenai/reward-bench
Apache License 2.0
375 stars 47 forks source link

Check EOS token on FastChat models #90

Closed natolambert closed 6 months ago

natolambert commented 6 months ago

TLDR:

Seems like FastChat models are not getting an EOS token. Could effect the non-DPO models that are using FastChat chat templates minorly

natolambert commented 6 months ago

Solution for the relevant models (will need more filtering code)

    ############################
    # Tokenization settings & dataset preparation
    ############################
    # set pad token to eos token if not set
    if reward_pipe.tokenizer.pad_token_id is None:
        reward_pipe.model.config.pad_token_id = reward_pipe.tokenizer.unk_token_id
        reward_pipe.tokenizer.pad_token_id = reward_pipe.tokenizer.unk_token_id
    # make tokenizer add eos
    reward_pipe.tokenizer.add_eos_token = True