-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding threshold to Transformers pipeline #14
Comments
Hi, sorry for the late response. Unfortunately, the threshold can't be added via the HuggingFace pipelines. Let us know if you have any other questions! |
Not sure if I'm doing this right, but this is the code I have so far:
I'm getting this error message when I run the code:
AttributeError: 'Tensor' object has no attribute '_label_list' |
Hi, Could you add the following lines of code:
Let us know if this piece of code did not work! |
I'm not understanding this piece of code:
what is the "labels" list supposed to be? |
We have an option to ignore the predictions for certain tokens, which can be specified via the labels argument. If we pass [O, NA, O, O, NA] as labels (assuming we have 5 tokens as input) the function ignores the predictions at positions 1 & 4 and return [P0, P2, P3] (predictions at the three positions). You don't need to use it, this is optional |
The decode method seems to require the labels list. I've tried to create labels list with the same shape as the predictions tensor, but I'm getting a different error. Code:
Error message:
|
I'm using this code to run inference:
I'm trying to increase the threshold, but can't find a config for it. Is it possible with my setup?
The text was updated successfully, but these errors were encountered: