mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-09 16:28:48 +01:00
Fix np.take (https://github.com/google/jax/issues/3774)
This commit is contained in:
parent
6502af086f
commit
31735c4239
@ -74,6 +74,7 @@ def apply_repetition_penalty_dynamic(logits, tokens, repetition_penalty):
|
|||||||
This gets called by generate_loop_fn to apply repetition penalty
|
This gets called by generate_loop_fn to apply repetition penalty
|
||||||
to the 1D array logits using the provided 1D array of tokens to penalize
|
to the 1D array logits using the provided 1D array of tokens to penalize
|
||||||
'''
|
'''
|
||||||
|
tokens = np.minimum(tokens, params["n_vocab"]-1) # https://github.com/google/jax/issues/3774
|
||||||
# Make a new array with the same length as the tokens array but with
|
# Make a new array with the same length as the tokens array but with
|
||||||
# each element replaced by the value at the corresponding index in the
|
# each element replaced by the value at the corresponding index in the
|
||||||
# logits array; e.g.
|
# logits array; e.g.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user