


import tempfile

import torch

from diffusers import PNDMScheduler

from .test_schedulers import SchedulerCommonTest




class A    (  UpperCamelCase_	):
      UpperCamelCase__				:    List[str] =(PNDMScheduler,)
      UpperCamelCase__				:    Dict =(('num_inference_steps', 50),)






      def 			lowerCamelCase			(   self		:	Dict     ,  **lowercase_		:	Dict					)   ->		str:
             """simple docstring"""




             _lowerCamelCase			:						List[Any]            ={
                 'num_train_timesteps': 1000,
                 'beta_start': 0.0001,
                 'beta_end': 0.02,
                 'beta_schedule': 'linear',
             }

             config.update(**lowercase_					)
             return config






      def 			lowerCamelCase			(   self		:	Any     ,  lowercase_		:	str=0     ,  **lowercase_		:	str					)   ->		Optional[int]:
             """simple docstring"""




             _lowerCamelCase			:						Optional[Any]            =dict(self.forward_default_kwargs					)
             _lowerCamelCase			:						Optional[Any]            =kwargs.pop('num_inference_steps'     ,  lowercase_					)
             _lowerCamelCase			:						Tuple            =self.dummy_sample
             _lowerCamelCase			:						int            =0.1 * sample
             _lowerCamelCase			:						int            =[residual + 0.2, residual + 0.15, residual + 0.1, residual + 0.05]

             for scheduler_class in self.scheduler_classes:
                    _lowerCamelCase			:						str            =self.get_scheduler_config(**lowercase_					)
                    _lowerCamelCase			:						str            =scheduler_class(**lowercase_					)
                    scheduler.set_timesteps(lowercase_					)
                    # copy over dummy past residuals
                    _lowerCamelCase			:						Any            =dummy_past_residuals[:]

                    with tempfile.TemporaryDirectory() as tmpdirname:
                           scheduler.save_config(lowercase_					)
                           _lowerCamelCase			:						Optional[Any]            =scheduler_class.from_pretrained(lowercase_					)
                           new_scheduler.set_timesteps(lowercase_					)
                           # copy over dummy past residuals
                           _lowerCamelCase			:						Any            =dummy_past_residuals[:]

                    _lowerCamelCase			:						Union[str, Any]            =scheduler.step_prk(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample
                    _lowerCamelCase			:						List[str]            =new_scheduler.step_prk(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample

                    assert torch.sum(torch.abs(output - new_output					)					) < 1E-5, "Scheduler outputs are not identical"

                    _lowerCamelCase			:						Optional[int]            =scheduler.step_plms(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample
                    _lowerCamelCase			:						Optional[Any]            =new_scheduler.step_plms(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample

                    assert torch.sum(torch.abs(output - new_output					)					) < 1E-5, "Scheduler outputs are not identical"






      def 			lowerCamelCase			(   self		:	Any					)   ->		Any:
             """simple docstring"""




             pass






      def 			lowerCamelCase			(   self		:	Union[str, Any]     ,  lowercase_		:	List[str]=0     ,  **lowercase_		:	int					)   ->		int:
             """simple docstring"""




             _lowerCamelCase			:						Any            =dict(self.forward_default_kwargs					)
             _lowerCamelCase			:						Dict            =kwargs.pop('num_inference_steps'     ,  lowercase_					)
             _lowerCamelCase			:						Union[str, Any]            =self.dummy_sample
             _lowerCamelCase			:						Optional[int]            =0.1 * sample
             _lowerCamelCase			:						List[str]            =[residual + 0.2, residual + 0.15, residual + 0.1, residual + 0.05]

             for scheduler_class in self.scheduler_classes:
                    _lowerCamelCase			:						Any            =self.get_scheduler_config()
                    _lowerCamelCase			:						int            =scheduler_class(**lowercase_					)
                    scheduler.set_timesteps(lowercase_					)

                    # copy over dummy past residuals (must be after setting timesteps)
                    _lowerCamelCase			:						Any            =dummy_past_residuals[:]

                    with tempfile.TemporaryDirectory() as tmpdirname:
                           scheduler.save_config(lowercase_					)
                           _lowerCamelCase			:						Optional[Any]            =scheduler_class.from_pretrained(lowercase_					)
                           # copy over dummy past residuals
                           new_scheduler.set_timesteps(lowercase_					)

                           # copy over dummy past residual (must be after setting timesteps)
                           _lowerCamelCase			:						Optional[int]            =dummy_past_residuals[:]

                    _lowerCamelCase			:						List[str]            =scheduler.step_prk(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample
                    _lowerCamelCase			:						str            =new_scheduler.step_prk(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample

                    assert torch.sum(torch.abs(output - new_output					)					) < 1E-5, "Scheduler outputs are not identical"

                    _lowerCamelCase			:						Optional[Any]            =scheduler.step_plms(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample
                    _lowerCamelCase			:						List[str]            =new_scheduler.step_plms(lowercase_     ,  lowercase_     ,  lowercase_     ,  **lowercase_					).prev_sample

                    assert torch.sum(torch.abs(output - new_output					)					) < 1E-5, "Scheduler outputs are not identical"






      def 			lowerCamelCase			(   self		:	Optional[Any]     ,  **lowercase_		:	Any					)   ->		Tuple:
             """simple docstring"""




             _lowerCamelCase			:						Union[str, Any]            =self.scheduler_classes[0]
             _lowerCamelCase			:						Optional[Any]            =self.get_scheduler_config(**lowercase_					)
             _lowerCamelCase			:						Any            =scheduler_class(**lowercase_					)

             _lowerCamelCase			:						Union[str, Any]            =10
             _lowerCamelCase			:						str            =self.dummy_model()
             _lowerCamelCase			:						Union[str, Any]            =self.dummy_sample_deter
             scheduler.set_timesteps(lowercase_					)

             for i, t in enumerate(scheduler.prk_timesteps					):
                    _lowerCamelCase			:						Union[str, Any]            =model(lowercase_     ,  lowercase_					)
                    _lowerCamelCase			:						Any            =scheduler.step_prk(lowercase_     ,  lowercase_     ,  lowercase_					).prev_sample

             for i, t in enumerate(scheduler.plms_timesteps					):
                    _lowerCamelCase			:						List[Any]            =model(lowercase_     ,  lowercase_					)
                    _lowerCamelCase			:						int            =scheduler.step_plms(lowercase_     ,  lowercase_     ,  lowercase_					).prev_sample

             return sample






      def 			lowerCamelCase			(   self		:	Dict					)   ->		List[Any]:
             """simple docstring"""




             _lowerCamelCase			:						Any            =dict(self.forward_default_kwargs					)

             _lowerCamelCase			:						Optional[int]            =kwargs.pop('num_inference_steps'     ,  lowercase_					)

             for scheduler_class in self.scheduler_classes:
                    _lowerCamelCase			:						List[str]            =self.get_scheduler_config()
                    _lowerCamelCase			:						List[Any]            =scheduler_class(**lowercase_					)

                    _lowerCamelCase			:						Union[str, Any]            =self.dummy_sample
                    _lowerCamelCase			:						Optional[int]            =0.1 * sample

                    if num_inference_steps is not None and hasattr(lowercase_     ,  'set_timesteps'					):
                           scheduler.set_timesteps(lowercase_					)
                    elif num_inference_steps is not None and not hasattr(lowercase_     ,  'set_timesteps'					):
                           _lowerCamelCase			:						Tuple            =num_inference_steps

                    # copy over dummy past residuals (must be done after set_timesteps)
                    _lowerCamelCase			:						List[Any]            =[residual + 0.2, residual + 0.15, residual + 0.1, residual + 0.05]
                    _lowerCamelCase			:						Union[str, Any]            =dummy_past_residuals[:]

                    _lowerCamelCase			:						List[Any]            =scheduler.step_prk(lowercase_     ,  0     ,  lowercase_     ,  **lowercase_					).prev_sample
                    _lowerCamelCase			:						str            =scheduler.step_prk(lowercase_     ,  1     ,  lowercase_     ,  **lowercase_					).prev_sample

                    self.assertEqual(output_a.shape     ,  sample.shape					)
                    self.assertEqual(output_a.shape     ,  output_a.shape					)

                    _lowerCamelCase			:						Tuple            =scheduler.step_plms(lowercase_     ,  0     ,  lowercase_     ,  **lowercase_					).prev_sample
                    _lowerCamelCase			:						Optional[Any]            =scheduler.step_plms(lowercase_     ,  1     ,  lowercase_     ,  **lowercase_					).prev_sample

                    self.assertEqual(output_a.shape     ,  sample.shape					)
                    self.assertEqual(output_a.shape     ,  output_a.shape					)






      def 			lowerCamelCase			(   self		:	Dict					)   ->		Any:
             """simple docstring"""




             for timesteps in [100, 1000]:
                    self.check_over_configs(num_train_timesteps=lowercase_					)






      def 			lowerCamelCase			(   self		:	Optional[int]					)   ->		Optional[Any]:
             """simple docstring"""




             for steps_offset in [0, 1]:
                    self.check_over_configs(steps_offset=lowercase_					)

             _lowerCamelCase			:						Optional[int]            =self.scheduler_classes[0]
             _lowerCamelCase			:						Dict            =self.get_scheduler_config(steps_offset=1					)
             _lowerCamelCase			:						List[Any]            =scheduler_class(**lowercase_					)
             scheduler.set_timesteps(10					)
             assert torch.equal(
                 scheduler.timesteps     ,  torch.LongTensor(
                     [901, 851, 851, 801, 801, 751, 751, 701, 701, 651, 651, 601, 601, 501, 401, 301, 201, 101, 1]					)     ,  )






      def 			lowerCamelCase			(   self		:	List[str]					)   ->		str:
             """simple docstring"""




             for beta_start, beta_end in zip([0.0001, 0.001]     ,  [0.002, 0.02]					):
                    self.check_over_configs(beta_start=lowercase_     ,  beta_end=lowercase_					)






      def 			lowerCamelCase			(   self		:	Tuple					)   ->		Union[str, Any]:
             """simple docstring"""




             for schedule in ["linear", "squaredcos_cap_v2"]:
                    self.check_over_configs(beta_schedule=lowercase_					)






      def 			lowerCamelCase			(   self		:	Tuple					)   ->		Any:
             """simple docstring"""




             for prediction_type in ["epsilon", "v_prediction"]:
                    self.check_over_configs(prediction_type=lowercase_					)






      def 			lowerCamelCase			(   self		:	Optional[Any]					)   ->		Union[str, Any]:
             """simple docstring"""




             for t in [1, 5, 10]:
                    self.check_over_forward(time_step=lowercase_					)






      def 			lowerCamelCase			(   self		:	List[str]					)   ->		List[Any]:
             """simple docstring"""




             for t, num_inference_steps in zip([1, 5, 10]     ,  [10, 50, 100]					):
                    self.check_over_forward(num_inference_steps=lowercase_					)






      def 			lowerCamelCase			(   self		:	int					)   ->		Optional[Any]:
             """simple docstring"""




             _lowerCamelCase			:						Optional[int]            =27

             for scheduler_class in self.scheduler_classes:
                    _lowerCamelCase			:						Dict            =self.dummy_sample
                    _lowerCamelCase			:						List[Any]            =0.1 * sample

                    _lowerCamelCase			:						List[Any]            =self.get_scheduler_config()
                    _lowerCamelCase			:						List[str]            =scheduler_class(**lowercase_					)

                    scheduler.set_timesteps(lowercase_					)

                    # before power of 3 fix, would error on first step, so we only need to do two
                    for i, t in enumerate(scheduler.prk_timesteps[:2]					):
                           _lowerCamelCase			:						Tuple            =scheduler.step_prk(lowercase_     ,  lowercase_     ,  lowercase_					).prev_sample






      def 			lowerCamelCase			(   self		:	List[str]					)   ->		Optional[int]:
             """simple docstring"""




             with self.assertRaises(lowercase_					):
                    _lowerCamelCase			:						Dict            =self.scheduler_classes[0]
                    _lowerCamelCase			:						Optional[Any]            =self.get_scheduler_config()
                    _lowerCamelCase			:						List[Any]            =scheduler_class(**lowercase_					)

                    scheduler.step_plms(self.dummy_sample     ,  1     ,  self.dummy_sample					).prev_sample






      def 			lowerCamelCase			(   self		:	List[str]					)   ->		List[str]:
             """simple docstring"""




             _lowerCamelCase			:						Tuple            =self.full_loop()
             _lowerCamelCase			:						Optional[Any]            =torch.sum(torch.abs(lowercase_					)					)
             _lowerCamelCase			:						Union[str, Any]            =torch.mean(torch.abs(lowercase_					)					)

             assert abs(result_sum.item() - 198.1318					) < 1E-2
             assert abs(result_mean.item() - 0.2580					) < 1E-3






      def 			lowerCamelCase			(   self		:	Any					)   ->		Optional[int]:
             """simple docstring"""




             _lowerCamelCase			:						int            =self.full_loop(prediction_type='v_prediction'					)
             _lowerCamelCase			:						Dict            =torch.sum(torch.abs(lowercase_					)					)
             _lowerCamelCase			:						str            =torch.mean(torch.abs(lowercase_					)					)

             assert abs(result_sum.item() - 67.3986					) < 1E-2
             assert abs(result_mean.item() - 0.0878					) < 1E-3






      def 			lowerCamelCase			(   self		:	Tuple					)   ->		Optional[Any]:
             """simple docstring"""




             _lowerCamelCase			:						Tuple            =self.full_loop(set_alpha_to_one=lowercase_     ,  beta_start=0.01					)
             _lowerCamelCase			:						Optional[Any]            =torch.sum(torch.abs(lowercase_					)					)
             _lowerCamelCase			:						Union[str, Any]            =torch.mean(torch.abs(lowercase_					)					)

             assert abs(result_sum.item() - 230.0399					) < 1E-2
             assert abs(result_mean.item() - 0.2995					) < 1E-3






      def 			lowerCamelCase			(   self		:	Optional[Any]					)   ->		Any:
             """simple docstring"""




             _lowerCamelCase			:						str            =self.full_loop(set_alpha_to_one=lowercase_     ,  beta_start=0.01					)
             _lowerCamelCase			:						Union[str, Any]            =torch.sum(torch.abs(lowercase_					)					)
             _lowerCamelCase			:						str            =torch.mean(torch.abs(lowercase_					)					)

             assert abs(result_sum.item() - 186.9482					) < 1E-2
             assert abs(result_mean.item() - 0.2434					) < 1E-3






import collections
import os
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


lowerCamelCase		   =			logging.get_logger(__name__)

lowerCamelCase		   =			'▁'

lowerCamelCase		   =			{'vocab_file': 'prophetnet.tokenizer'}

lowerCamelCase		   =			{
    'vocab_file': {
        'microsoft/xprophetnet-large-wiki100-cased': (
            'https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/prophetnet.tokenizer'
        ),
    }
}

lowerCamelCase		   =			{
    'microsoft/xprophetnet-large-wiki100-cased': {'do_lower_case': False},
}

lowerCamelCase		   =			{
    'microsoft/xprophetnet-large-wiki100-cased': 5_12,
}




def       a_ (       SCREAMING_SNAKE_CASE__   : Any	):
       '''simple docstring'''





       _lowerCamelCase			:						List[str]            =collections.OrderedDict()
       with open(SCREAMING_SNAKE_CASE__						,     'r'						,     encoding='utf-8'	) as reader:
              _lowerCamelCase			:						Dict            =reader.readlines()
       for index, token in enumerate(SCREAMING_SNAKE_CASE__	):
              _lowerCamelCase			:						int            =token.rstrip('\n'	)
              _lowerCamelCase			:						Tuple            =index
       return vocab




class A    (  UpperCamelCase_	):
      UpperCamelCase__				:    str =VOCAB_FILES_NAMES
      UpperCamelCase__				:    int =PRETRAINED_VOCAB_FILES_MAP
      UpperCamelCase__				:    List[Any] =PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      UpperCamelCase__				:    int =['input_ids', 'attention_mask']






      def __init__(   self		:	Tuple     ,  lowercase_		:	Union[str, Any]     ,  lowercase_		:	List[str]="[SEP]"     ,  lowercase_		:	Any="[SEP]"     ,  lowercase_		:	Optional[int]="[SEP]"     ,  lowercase_		:	Optional[Any]="[UNK]"     ,  lowercase_		:	int="[PAD]"     ,  lowercase_		:	Union[str, Any]="[CLS]"     ,  lowercase_		:	Optional[int]="[MASK]"     ,  lowercase_		:	Optional[Dict[str, Any]] = None     ,  **lowercase_		:	str     ,  )   ->		None:
             """simple docstring"""




             _lowerCamelCase			:						int            ={} if sp_model_kwargs is None else sp_model_kwargs

             super().__init__(
                 bos_token=lowercase_     ,  eos_token=lowercase_     ,  sep_token=lowercase_     ,  unk_token=lowercase_     ,  pad_token=lowercase_     ,  cls_token=lowercase_     ,  mask_token=lowercase_     ,  sp_model_kwargs=self.sp_model_kwargs     ,  **lowercase_     ,  )

             try:
                    import sentencepiece as spm
             except ImportError:
                    logger.warning(
                        'You need to install SentencePiece to use XLMRobertaTokenizer: https://github.com/google/sentencepiece'
                        ' pip install sentencepiece'					)
                    raise

             _lowerCamelCase			:						Optional[int]            =spm.SentencePieceProcessor(**self.sp_model_kwargs					)
             self.sp_model.Load(str(lowercase_					)					)
             _lowerCamelCase			:						Dict            =vocab_file

             # Original fairseq vocab and spm vocab must be "aligned":
             # Vocab    |    0    |    1    |   2    |    3    |  4  |  5  |  6  |   7   |   8   |  9
             # -------- | ------- | ------- | ------ | ------- | --- | --- | --- | ----- | ----- | ----
             # fairseq  | '<s>'   | '<pad>' | '</s>' | '<unk>' | ',' | '.' | '▁' | 's'   | '▁de' | '-'
             # spm      | '<unk>' | '<s>'   | '</s>' | ','     | '.' | '▁' | 's' | '▁de' | '-'   | '▁a'

             # put special tokens and [unused] tokens into the vocab
             _lowerCamelCase			:						int            ={'[PAD]': 0, '[CLS]': 1, '[SEP]': 2, '[UNK]': 3, '[MASK]': 4}

             for i in range(10					):
                    _lowerCamelCase			:						Dict            =F'''[unused{i}]'''
                    _lowerCamelCase			:						List[str]            =5 + i

             # The first "real" token "," has position 15 in the embedding vocab and position 3 in the spm vocab
             _lowerCamelCase			:						Any            =12
             _lowerCamelCase			:						Dict            ={v: k for k, v in self.fairseq_tokens_to_ids.items()}
             for k in self.fairseq_tokens_to_ids.keys():
                    self.unique_no_split_tokens.append(lowercase_					)






      def __getstate__(   self		:	int					)   ->		Union[str, Any]:
             """simple docstring"""




             _lowerCamelCase			:						Dict            =self.__dict__.copy()
             _lowerCamelCase			:						Dict            =None
             return state






      def __setstate__(   self		:	str     ,  lowercase_		:	Union[str, Any]					)   ->		Union[str, Any]:
             """simple docstring"""




             _lowerCamelCase			:						List[str]            =d
             try:
                    import sentencepiece as spm
             except ImportError:
                    logger.warning(
                        'You need to install SentencePiece to use XLMRobertaTokenizer: https://github.com/google/sentencepiece'
                        ' pip install sentencepiece'					)
                    raise

             # for backward compatibility
             if not hasattr(self     ,  'sp_model_kwargs'					):
                    _lowerCamelCase			:						Any            ={}

             _lowerCamelCase			:						Optional[Any]            =spm.SentencePieceProcessor(**self.sp_model_kwargs					)
             self.sp_model.Load(self.vocab_file					)






      def 			lowerCamelCase			(   self		:	List[str]     ,  lowercase_		:	List[int]     ,  lowercase_		:	Optional[List[int]] = None     ,  lowercase_		:	bool = False					)   ->		List[int]:
             """simple docstring"""




             if already_has_special_tokens:
                    return super().get_special_tokens_mask(
                        token_ids_a=lowercase_     ,  token_ids_a=lowercase_     ,  already_has_special_tokens=lowercase_					)

             if token_ids_a is None:
                    return ([0] * len(lowercase_					)) + [1]
             return ([0] * len(lowercase_					)) + [1] + ([0] * len(lowercase_					)) + [1]






      def 			lowerCamelCase			(   self		:	List[str]     ,  lowercase_		:	List[int]     ,  lowercase_		:	Optional[List[int]] = None					)   ->		List[int]:
             """simple docstring"""




             _lowerCamelCase			:						Any            =[self.sep_token_id]

             if token_ids_a is None:
                    return len(token_ids_a + sep					) * [0]
             return len(token_ids_a + sep + sep + token_ids_a + sep					) * [0]






      @property
      def 			lowerCamelCase			(   self		:	Any					)   ->		Optional[Any]:
             """simple docstring"""




             return len(self.sp_model					) + self.fairseq_offset






      def 			lowerCamelCase			(   self		:	Dict					)   ->		Optional[int]:
             """simple docstring"""




             _lowerCamelCase			:						List[Any]            ={self.convert_ids_to_tokens(lowercase_					): i for i in range(self.vocab_size					)}
             vocab.update(self.added_tokens_encoder					)
             return vocab






      def 			lowerCamelCase			(   self		:	List[Any]     ,  lowercase_		:	str					)   ->		str:
             """simple docstring"""




             return self.sp_model.encode(lowercase_     ,  out_type=lowercase_					)






      def 			lowerCamelCase			(   self		:	List[str]     ,  lowercase_		:	Dict					)   ->		str:
             """simple docstring"""




             if token in self.fairseq_tokens_to_ids:
                    return self.fairseq_tokens_to_ids[token]
             _lowerCamelCase			:						Optional[int]            =self.sp_model.PieceToId(lowercase_					)

             # Need to return unknown token if the SP model returned 0
             return spm_id + self.fairseq_offset if spm_id else self.unk_token_id






      def 			lowerCamelCase			(   self		:	str     ,  lowercase_		:	Dict					)   ->		Any:
             """simple docstring"""




             if index in self.fairseq_ids_to_tokens:
                    return self.fairseq_ids_to_tokens[index]
             return self.sp_model.IdToPiece(index - self.fairseq_offset					)






      def 			lowerCamelCase			(   self		:	Any     ,  lowercase_		:	List[str]					)   ->		Tuple:
             """simple docstring"""




             _lowerCamelCase			:						int            =''.join(lowercase_					).replace(lowercase_     ,  ' '					).strip()
             return out_string






      def 			lowerCamelCase			(   self		:	int     ,  lowercase_		:	str     ,  lowercase_		:	Optional[str] = None					)   ->		Tuple[str]:
             """simple docstring"""




             if not os.path.isdir(lowercase_					):
                    logger.error(F'''Vocabulary path ({save_directory}) should be a directory'''					)
                    return
             _lowerCamelCase			:						Dict            =os.path.join(
                 lowercase_     ,  (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']					)

             if os.path.abspath(self.vocab_file					) != os.path.abspath(lowercase_					) and os.path.isfile(self.vocab_file					):
                    copyfile(self.vocab_file     ,  lowercase_					)
             elif not os.path.isfile(self.vocab_file					):
                    with open(lowercase_     ,  'wb'					) as fi:
                           _lowerCamelCase			:						Dict            =self.sp_model.serialized_model_proto()
                           fi.write(lowercase_					)

             return (out_vocab_file,)






      def 			lowerCamelCase			(   self		:	List[str]     ,  lowercase_		:	List[int]     ,  lowercase_		:	Optional[List[int]] = None					)   ->		List[int]:
             """simple docstring"""




             if token_ids_a is None:
                    return token_ids_a + [self.sep_token_id]
             _lowerCamelCase			:						Any            =[self.sep_token_id]
             return token_ids_a + sep + token_ids_a + sep


