Skip to content

Commit 9b96e6f

Browse files
Update keras_hub/src/samplers/top_p_sampler.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 47bc15e commit 9b96e6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

keras_hub/src/samplers/top_p_sampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def get_next_token(self, probabilities):
8181
sorted_next_token = random.categorical(
8282
# tf does not support half precision multinomial sampling, so make
8383
# sure we have full precision here.
84-
ops.cast(ops.log(probabilities), "float32"),
84+
ops.log(ops.cast(probabilities, "float32")),
8585
1,
8686
seed=self.seed_generator,
8787
dtype="int32",

0 commit comments

Comments
 (0)