code: def change_tokenization(tokens, tokenizer1, tokenizer2):
      """Change the tokenizer of the tokens
  
      Args:
          tokens (torch.Tensor): Tokens to be changed
          tokenizer1 (transformers.PreTrainedTokenizer): Tokenizer to be changed
          tokenizer2 (transformers.PreTrainedTokenizer): Tokenizer to be
              changed to
  
      Returns:
          encoded_tokens: Encoded tokens
      """
  
      # decode tokens
      with torch.no_grad():
          decoded_tokens = [
              tokenizer1.decode(token) for i, token in enumerate(tokens)
          ]
  
          # remove all the pad tokens
          decoded_tokens = [
              token.replace(tokenizer1.pad_token, "")
              for token in decoded_tokens
          ]
  
          # remove all the eos tokens
          decoded_tokens = [
              token.replace(tokenizer1.eos_token, "")
              for token in decoded_tokens
          ]
  
          # encode the actions with critic tokenizer
          encoded_tokens = tokenizer2(
              decoded_tokens,
              return_tensors="pt",
              padding=True,
              truncation=True,
          )
  
      return encoded_tokens
  
imports: import json
  import os
  import random
  from collections import deque, namedtuple
  import deepspeed
  import torch
  import torch.distributed
  from accelerate import Accelerator
  from beartype import beartype
  from beartype.typing import Deque, List, Tuple, Union
  from deepspeed.runtime.engine import DeepSpeedEngine
  from torch.utils.data import DataLoader, Dataset
  from torch.optim.lr_scheduler import CosineAnnealingWarmRestarts
  from chatllama.rlhf.actor import ActorModel
  from chatllama.rlhf.config import Config, ConfigActor, ConfigCritic, ConfigReward
  from chatllama.rlhf.model_list import hf_models
  from chatllama.rlhf.model_loader import ModelLoader
  from chatllama.rlhf.reward import RewardModel, CriticModel
  from chatllama.rlhf.utils import TrainingStats, ConversationLog
label_desc: Use image node_id 1 for calling a global function with example usage: change_tokenization(tokens, tokenizer1, tokenizer2) and returns: encoded_tokens