code: def stream(self):
      # Check total response length
  
      if self.remaining_tokens == 0:
          self.sequence_str += self.held_text
          return self.held_text, True
  
      self.remaining_tokens -= 1
  
      # Decode the current tail end of the sequence
  
      old_tail = self.tokenizer.decode(
          self.sequence_ids[:, -self.max_stop_tokens :]
      )[0]
  
      # Generate a single token and append to the sequence
  
      next_token = self.gen_single_token(self.settings)
  
      # End immediately if it was a stop token
  
      if next_token in self.stop_tokens:
          self.sequence_str += self.held_text
          return self.held_text, True
  
      # Decode the tail end of the sequence with the added token to get (actual) characters added
  
      new_tail = self.tokenizer.decode(
          self.sequence_ids[:, -(self.max_stop_tokens + 1) :]
      )[0]
      self.held_text += new_tail[len(old_tail) :]
  
      # Hold text as long as it contains part of a stop string
  
      partial_ss = False
      for ss in self.stop_strings:
          # Check if held_text fully contains stop string
  
          position = self.held_text.find(ss)
          if position != -1:
              self.sequence_str += self.held_text[:position]
              return self.held_text[:position], True
  
          # Check for overlap between end of held_text and start of stop string
  
          overlap = 0
          for j in range(1, min(len(self.held_text), len(ss)) + 1):
              if self.held_text[-j:] == ss[:j]:
                  overlap = j
          if overlap > 0:
              partial_ss = True
  
      # If holding text because of a partial stop condition, return nothing but also EOS = False
  
      if partial_ss:
          return "", False
  
      # No stop condition, so return whatever has been generated
  
      stream_text = self.held_text
      self.held_text = ""
      self.sequence_str += stream_text
      return stream_text, False
  
file_path: exllama/alt_generator.py
imports: import cuda_ext
  from model import ExLlama, ExLlamaCache
  from tokenizer import ExLlamaTokenizer
  from lora import ExLlamaLora
  import torch
  import torch.nn.functional
label_desc: Use image node_id 5 for calling the ExLlamaAltGenerator obj's underlying member method code with example usage: obj.stream() and returns: stream_text,  False, self,  True, self,  True, str,  False, self,  True