Why is [-choice] used instead of [choice]? Can anyone please help me understand that?
Hope this helps:
- Get model predictions.
-
np.argsort
will list the indices that correspond to theprobabilities
when sorted in ascending order. - Select a token index based on these indices. When choice is negative, you’ll end up picking an index from the end.
-1
corresponds to the last element in the list which has the highest value for the probability.
1 Like
It makes sense. Thanks!