You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since version v4.36.0 of huggingface transformers, it is not allowed to have prefix_allowed_tokens_fn return an empty set of tokens 27797.
When doing non-free generation on GENRE, which is based on candidates, the output of the lambda assigned to prefix_allowed_tokens_fn may indeed be an empty list, raising a ValueError with the following message:
f"`prefix_allowed_tokens_fn` returned an empty list for batch ID {batch_id}."
"This means that the constraint is unsatisfiable. Please check your implementation"
f"of `prefix_allowed_tokens_fn` "
I have not reproduced the case for free generation, and it seems the code I use for per-mention Trie creation is no longer presented in examples.ipynb :
trie = Trie([
[2] + model.encode(e).tolist()[1:]
for e in doc["candidates"]
])
if doc["candidates"] else Trie([[2] + self.model.encode("NIL").tolist()[1:]])
Anyway, it is recommended to stick to versions < v4.36.0 (such as v4.35.2) if one falls into that error.
This condition may be added to requirements.txt
The text was updated successfully, but these errors were encountered:
Since version v4.36.0 of huggingface transformers, it is not allowed to have prefix_allowed_tokens_fn return an empty set of tokens 27797.
When doing non-free generation on GENRE, which is based on candidates, the output of the lambda assigned to
prefix_allowed_tokens_fn
may indeed be an empty list, raising a ValueError with the following message:I have not reproduced the case for free generation, and it seems the code I use for per-mention Trie creation is no longer presented in examples.ipynb :
Anyway, it is recommended to stick to versions < v4.36.0 (such as v4.35.2) if one falls into that error.
This condition may be added to requirements.txt
The text was updated successfully, but these errors were encountered: