Skip to content

Conversation

@Ktakuya332C
Copy link
Contributor

@Ktakuya332C Ktakuya332C commented Oct 6, 2025

概要

  • bosトークンがないモデル(Qwen系)に対してperplexityを計算しようとするとモデルの入力にNoneが混入し落ちます。
  • bosトークンがない場合には代わりにeosトークンを入れることで、落ちるのを防ぎます

詳細

  • bosトークンがないモデルはtokenizer.bos_tokenがNoneなので、入力セグメント全てのprefixがNoneになってしまい、vllmやhfモデルへの入力がNoneになります。
  • bosトークンがない場合にはだいたい 文章1<eos>文章2 という形で事前学習がなされているはずなので、今回の変更を入れることで上のchunkの <eos>文章2 という部分をとってきた場合のperplexityを計算するようにします。

@Ktakuya332C Ktakuya332C requested a review from a team October 6, 2025 06:02
@Ktakuya332C Ktakuya332C marked this pull request as ready for review October 6, 2025 06:02
Copy link
Contributor

@ryokan0123 ryokan0123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ktakuya332C Ktakuya332C merged commit 0a10787 into main Oct 7, 2025
8 checks passed
@Ktakuya332C Ktakuya332C deleted the fix/logprobs-without-bos-token branch October 7, 2025 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants