From 2e50a9b479d9e84e420416c8f9b687c70fcc5fa4 Mon Sep 17 00:00:00 2001 From: yinglin-nv Date: Thu, 27 Jun 2024 11:28:10 -0700 Subject: [PATCH] FIX | Update serve_trt.py Remove lines that handle out-of-range IDs which are not needed now and may cause issues. --- nemo_skills/inference/server/serve_trt.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/nemo_skills/inference/server/serve_trt.py b/nemo_skills/inference/server/serve_trt.py index 8d3b81bec..bb98b9065 100644 --- a/nemo_skills/inference/server/serve_trt.py +++ b/nemo_skills/inference/server/serve_trt.py @@ -160,9 +160,6 @@ def get_output_single(output_ids, input_length, max_output_len, tokenizer, eos_t if len(eos_ids) > 0: outputs = outputs[: eos_ids[0]] outputs = outputs.tolist() - # somehow sometimes it produces tokens out of range.. - outputs = [elem if elem < tokenizer.vocab_size else tokenizer.vocab_size - 1 for elem in outputs] - outputs = [elem if 0 <= elem else 0 for elem in outputs] return tokenizer.decode(outputs)