code: def get_stop_token_ids(tokenizer, stop_sequences=[]):
      stop_token_ids = [
          tokenizer.added_tokens_encoder[x]
          for x in stop_sequences
          if hasattr(tokenizer, "added_tokens_encoder")
          and x in tokenizer.added_tokens_encoder
      ]
      if hasattr(tokenizer, "eos_token_id"):
          stop_token_ids.extend([tokenizer.eos_token_id])
      stop_token_ids_dict = dict(stop_token_ids=stop_token_ids)
      return stop_token_ids_dict
  
file_path: h2ogpt/src/prompter.py
imports: import ast
  import time
  from enums import PromptType, gpt_token_mapping, anthropic_mapping, google_mapping, mistralai_mapping
label_desc: Use image node_id 8 for calling a global function with example usage: get_stop_token_ids(tokenizer, stop_sequences) and returns: stop_token_ids_dict