class_docstr: Transformers handler class for sequence, token classification and question answering.
class_docstr_tok: ["Transformers","handler","class","for","sequence",",","token","classification","and","question","answering","."]
code: def _clean_cache(self):
      new_ids = set(self.context.request_ids.values())
      self.batch_idx_to_req_ids = [
          key if key in new_ids else None
          for key in self.batch_idx_to_req_ids
      ]
      self._compact_kv_cache()
  
imports: import json
  import logging
  import os
  import sys
  import time
  from abc import ABC
  from typing import List
  import packaging.version
  import requests
  import torch
  import transformers
  from ts.torch_handler.base_handler import BaseHandler
  from generate import sample_top_p
  from llama2 import Llama
label_desc: Use image node_id 13 for calling the LlamaHandler obj's underlying member method code with example usage: obj._clean_cache() without return types