Change top_k to be disabled with 0 (still accept -1 for now) (#17773)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -348,7 +348,7 @@ class NeuronModelRunner(ModelRunnerBase[ModelInputForNeuron]):
|
||||
if temperature == 0.0:
|
||||
# Enable greedy sampling on zero temperature
|
||||
return (1, 1.0, 1.0)
|
||||
if top_k < 0 or top_k > self._MAX_NEURON_SAMPLING_TOP_K:
|
||||
if top_k < 1 or top_k > self._MAX_NEURON_SAMPLING_TOP_K:
|
||||
top_k = self._MAX_NEURON_SAMPLING_TOP_K
|
||||
|
||||
return (top_k, top_p, temperature)
|
||||
|
||||
@@ -525,7 +525,7 @@ class TPUModelRunner(ModelRunnerBase[ModelInputForTPU]):
|
||||
"Top-p sampling is currently disabled for the TPU backend "
|
||||
"due to performance issues.")
|
||||
p.append(sampling_params.top_p)
|
||||
if sampling_params.top_k != -1:
|
||||
if sampling_params.top_k > 0:
|
||||
raise NotImplementedError(
|
||||
"Top-k sampling is currently disabled for the TPU backend "
|
||||
"due to performance issues.")
|
||||
|
||||
Reference in New Issue
Block a user