code: def _convert_to_tensors(self, input_text, task_id=2):
      model_inputs = {}
      input_ids = [self.tokenizer.bos_id] + self.tokenizer.encode(
          input_text
      )
      input_ids = [j for j in input_ids if j != self.tokenizer.unk_id]
  
      model_inputs["input"] = [
          x + self.prompt_length * task_id
          for x in range(self.prompt_length)
      ] + input_ids
      model_inputs["length"] = len(model_inputs["input"])
      model_inputs["position"] = list(range(len(model_inputs["input"])))
      model_inputs["span"] = [0] * len(model_inputs["input"])
      model_inputs["context"] = [True] * len(model_inputs["input"])
      model_inputs["segment"] = [0] * self.prompt_length + [2] * len(
          input_ids
      )
  
      for key in model_inputs:
          model_inputs[key] = (
              torch.tensor(model_inputs[key]).int().unsqueeze(0)
          )
  
      return model_inputs
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/generation/ant.py
imports: import torch
  import torch.nn.functional
  from .generation_utils import BeamHypotheses, apply_repetition_penalty, top_k_top_p_filtering
  from ..utils import pad
label_desc: Use image node_id 2 for calling the CPMAntGeneration obj's underlying member method code with example usage: obj._convert_to_tensors(input_text, task_id) and returns: model_inputs