code: def decode_n_tokens(
      self,
      cur_token: torch.Tensor,
      input_pos: torch.Tensor,
      num_new_tokens: int,
      callback=lambda _: _,
      **sampling_kwargs,
  ):
      new_tokens, new_probs = [], []
      for i in range(num_new_tokens):
          with torch.backends.cuda.sdp_kernel(
              enable_flash=False,
              enable_mem_efficient=False,
              enable_math=True,
          ):  # Actually better for Inductor to codegen attention here
              next_token, next_prob = self.decode_one_token(
                  self.model, cur_token, input_pos, **sampling_kwargs
              )
          input_pos += 1
          new_tokens.append(next_token.clone())
          callback(new_tokens[-1])
          new_probs.append(next_prob.clone())
          cur_token = next_token.view(1, -1)
      return new_tokens, new_probs
  
file_path: serve/examples/large_models/gpt_fast/handler.py
imports: import json
  import logging
  import time
  from pathlib import Path
  import torch
  from generate import Transformer, _load_model, decode_one_token, encode_tokens, logits_to_probs, maybe_init_dist, model_forward, multinomial_sample_one_no_sync, prefill
  from sentencepiece import SentencePieceProcessor
  from ts.handler_utils.timer import timed
  from ts.handler_utils.utils import send_intermediate_predict_response
  from ts.torch_handler.base_handler import BaseHandler
label_desc: Use image node_id 7 for calling the GptHandler obj's underlying member method code with example usage: obj.decode_n_tokens(cur_token, input_pos, num_new_tokens, callback) and returns: new_tokens,  new_probs