Closed wuzhiye7 closed 1 year ago
now i found this is a bug for transformers PrefixConstrainedLogitsProcessor ,haved fixed it
Hi, I want to use prefix_allowed_tokens_fn in decoder only model, but I can't find how to do it. Can you tell me how did you done prefix_allowed_tokens_fn to encoder only model? That could be a hint for me, too
i tried another encoder only model with prefix_allowed_tokens_fn . found that this function not work well. it always generate one token which is not in allowed tokens list . so,is prefix_allowed_tokens_fn just working for hf seq2seq model.generate?