"""simple docstring"""





import math
from collections import defaultdict
from typing import List, Optional, Tuple, Union

import numpy as np
import torch

from ..configuration_utils import ConfigMixin, register_to_config
from .scheduling_utils import KarrasDiffusionSchedulers, SchedulerMixin, SchedulerOutput


def    lowercase_   (   _lowerCamelCase:	Optional[Any]						,   _lowerCamelCase:	List[Any]=0.999						,   _lowerCamelCase:	Tuple="cosine"						,   ) ->      Any:



							'''simple docstring'''

							if alpha_transform_type == "cosine":

														def alpha_bar_fn(_lowerCamelCase:	Any      ):
																					return math.cos((t + 0.008) / 1.008 * math.pi / 2      ) ** 2

							elif alpha_transform_type == "exp":

														def alpha_bar_fn(_lowerCamelCase:	Optional[int]      ):
																					return math.exp(t * -12.0      )

							else:
														raise ValueError(F"""Unsupported alpha_tranform_type: {alpha_transform_type}"""      )

							__lowerCamelCase					:		Dict		   =     []
							for i in range(_UpperCamelCase      ):
														__lowerCamelCase					:		int		   =     i / num_diffusion_timesteps
														__lowerCamelCase					:		List[Any]		   =     (i + 1) / num_diffusion_timesteps
														betas.append(min(1 - alpha_bar_fn(_UpperCamelCase      ) / alpha_bar_fn(_UpperCamelCase      )						,   _UpperCamelCase      )      )
							return torch.tensor(_UpperCamelCase						,   dtype=torch.floataa      )







class  _snake_case     (					a__				, a__		):
						snake_case__			  =			[e.name for e in KarrasDiffusionSchedulers]
						snake_case__			  =			2






						@register_to_config
						def __init__(       self      :			Dict							,					UpperCAmelCase      :			Union[str, Any] = 1000							,					UpperCAmelCase      :			Any = 0.0_0_0_8_5							,					UpperCAmelCase      :			Dict = 0.0_1_2							,					UpperCAmelCase      :			Optional[int] = "linear"							,					UpperCAmelCase      :			Tuple = None							,					UpperCAmelCase      :			List[Any] = "epsilon"							,					UpperCAmelCase      :			Tuple = False							,					UpperCAmelCase      :			Any = False							,					UpperCAmelCase      :			Optional[int] = 1.0							,					UpperCAmelCase      :			int = "linspace"							,					UpperCAmelCase      :			Union[str, Any] = 0							,					):

													if trained_betas is not None:
																				__lowerCamelCase					:		Optional[int]		   =     torch.tensor(UpperCAmelCase							,					dtype=torch.floataa    )
													elif beta_schedule == "linear":
																				__lowerCamelCase					:		int		   =     torch.linspace(UpperCAmelCase							,					UpperCAmelCase							,					UpperCAmelCase							,					dtype=torch.floataa    )
													elif beta_schedule == "scaled_linear":
																				# this schedule is very specific to the latent diffusion model.
																				__lowerCamelCase					:		int		   =     (
																				    torch.linspace(beta_start**0.5							,					beta_end**0.5							,					UpperCAmelCase							,					dtype=torch.floataa    ) ** 2
																				)
													elif beta_schedule == "squaredcos_cap_v2":
																				# Glide cosine schedule
																				__lowerCamelCase					:		str		   =     betas_for_alpha_bar(UpperCAmelCase							,					alpha_transform_type="cosine"    )
													elif beta_schedule == "exp":
																				__lowerCamelCase					:		Tuple		   =     betas_for_alpha_bar(UpperCAmelCase							,					alpha_transform_type="exp"    )
													else:
																				raise NotImplementedError(F"""{beta_schedule} does is not implemented for {self.__class__}"""    )

													__lowerCamelCase					:		Union[str, Any]		   =     1.0 - self.betas
													__lowerCamelCase					:		Any		   =     torch.cumprod(self.alphas							,					dim=0    )

													#  set all values
													self.set_timesteps(UpperCAmelCase							,					UpperCAmelCase							,					UpperCAmelCase    )
													__lowerCamelCase					:		int		   =     use_karras_sigmas






						def       lowerCamelCase__     (       self      :			Tuple							,					UpperCAmelCase      :			Tuple							,					UpperCAmelCase      :			Any=None    ):

													if schedule_timesteps is None:
																				__lowerCamelCase					:		str		   =     self.timesteps

													__lowerCamelCase					:		str		   =     (schedule_timesteps == timestep).nonzero()

													# The sigma index that is taken for the **very** first `step`
													# is always the second index (or the last index if there is only 1)
													# This way we can ensure we don't accidentally skip a sigma in
													# case we start in the middle of the denoising schedule (e.g. for image-to-image)
													if len(self._index_counter    ) == 0:
																				__lowerCamelCase					:		Optional[Any]		   =     1 if len(UpperCAmelCase    ) > 1 else 0
													else:
																				__lowerCamelCase					:		Tuple		   =     timestep.cpu().item() if torch.is_tensor(UpperCAmelCase    ) else timestep
																				__lowerCamelCase					:		Optional[int]		   =     self._index_counter[timestep_int]

													return indices[pos].item()






						@property
						def       lowerCamelCase__     (       self      :			str    ):

													if self.config.timestep_spacing in ["linspace", "trailing"]:
																				return self.sigmas.max()

													return (self.sigmas.max() ** 2 + 1) ** 0.5






						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			Union[str, Any]							,					UpperCAmelCase      :			int							,					):
													__lowerCamelCase					:		Dict		   =     self.index_for_timestep(UpperCAmelCase    )

													__lowerCamelCase					:		Tuple		   =     self.sigmas[step_index]
													__lowerCamelCase					:		List[str]		   =     sample / ((sigma**2 + 1) ** 0.5)
													return sample






						def       lowerCamelCase__     (       self      :			Any							,					UpperCAmelCase      :			Tuple							,					UpperCAmelCase      :			str = None							,					UpperCAmelCase      :			List[Any] = None							,					):
													__lowerCamelCase					:		List[Any]		   =     num_inference_steps

													__lowerCamelCase					:		Any		   =     num_train_timesteps or self.config.num_train_timesteps

													# "linspace", "leading", "trailing" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891
													if self.config.timestep_spacing == "linspace":
																				__lowerCamelCase					:		str		   =     np.linspace(0							,					num_train_timesteps - 1							,					UpperCAmelCase							,					dtype=UpperCAmelCase    )[::-1].copy()
													elif self.config.timestep_spacing == "leading":
																				__lowerCamelCase					:		int		   =     num_train_timesteps // self.num_inference_steps
																				# creates integer timesteps by multiplying by ratio
																				# casting to int to avoid issues when num_inference_step is power of 3
																				__lowerCamelCase					:		Union[str, Any]		   =     (np.arange(0							,					UpperCAmelCase    ) * step_ratio).round()[::-1].copy().astype(UpperCAmelCase    )
																				timesteps += self.config.steps_offset
													elif self.config.timestep_spacing == "trailing":
																				__lowerCamelCase					:		int		   =     num_train_timesteps / self.num_inference_steps
																				# creates integer timesteps by multiplying by ratio
																				# casting to int to avoid issues when num_inference_step is power of 3
																				__lowerCamelCase					:		Any		   =     (np.arange(UpperCAmelCase							,					0							,					-step_ratio    )).round().copy().astype(UpperCAmelCase    )
																				timesteps -= 1
													else:
																				raise ValueError(
																				    F"""{self.config.timestep_spacing} is not supported. Please make sure to choose one of 'linspace', 'leading' or 'trailing'."""    )

													__lowerCamelCase					:		Optional[Any]		   =     np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5    )
													__lowerCamelCase					:		Any		   =     np.log(UpperCAmelCase    )
													__lowerCamelCase					:		List[str]		   =     np.interp(UpperCAmelCase							,					np.arange(0							,					len(UpperCAmelCase    )    )							,					UpperCAmelCase    )

													if self.config.use_karras_sigmas:
																				__lowerCamelCase					:		str		   =     self._convert_to_karras(in_sigmas=UpperCAmelCase							,					num_inference_steps=self.num_inference_steps    )
																				__lowerCamelCase					:		int		   =     np.array([self._sigma_to_t(UpperCAmelCase							,					UpperCAmelCase    ) for sigma in sigmas]    )

													__lowerCamelCase					:		Optional[Any]		   =     np.concatenate([sigmas, [0.0]]    ).astype(np.floataa    )
													__lowerCamelCase					:		str		   =     torch.from_numpy(UpperCAmelCase    ).to(device=UpperCAmelCase    )
													__lowerCamelCase					:		Tuple		   =     torch.cat([sigmas[:1], sigmas[1:-1].repeat_interleave(2    ), sigmas[-1:]]    )

													__lowerCamelCase					:		str		   =     torch.from_numpy(UpperCAmelCase    )
													__lowerCamelCase					:		int		   =     torch.cat([timesteps[:1], timesteps[1:].repeat_interleave(2    )]    )

													if str(UpperCAmelCase    ).startswith("mps"    ):
																				# mps does not support float64
																				__lowerCamelCase					:		Dict		   =     timesteps.to(UpperCAmelCase							,					dtype=torch.floataa    )
													else:
																				__lowerCamelCase					:		Optional[Any]		   =     timesteps.to(device=UpperCAmelCase    )

													# empty dt and derivative
													__lowerCamelCase					:		Optional[Any]		   =     None
													__lowerCamelCase					:		Dict		   =     None

													# for exp beta schedules, such as the one for `pipeline_shap_e.py`
													# we need an index counter
													__lowerCamelCase					:		int		   =     defaultdict(UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			int							,					UpperCAmelCase      :			Optional[int]							,					UpperCAmelCase      :			Union[str, Any]    ):
													__lowerCamelCase					:		Optional[Any]		   =     np.log(UpperCAmelCase    )

													# get distribution
													__lowerCamelCase					:		Tuple		   =     log_sigma - log_sigmas[:, np.newaxis]

													# get sigmas range
													__lowerCamelCase					:		int		   =     np.cumsum((dists >= 0)							,					axis=0    ).argmax(axis=0    ).clip(max=log_sigmas.shape[0] - 2    )
													__lowerCamelCase					:		List[Any]		   =     low_idx + 1

													__lowerCamelCase					:		Union[str, Any]		   =     log_sigmas[low_idx]
													__lowerCamelCase					:		Dict		   =     log_sigmas[high_idx]

													# interpolate sigmas
													__lowerCamelCase					:		Dict		   =     (low - log_sigma) / (low - high)
													__lowerCamelCase					:		List[str]		   =     np.clip(UpperCAmelCase							,					0							,					1    )

													# transform interpolation to time range
													__lowerCamelCase					:		Tuple		   =     (1 - w) * low_idx + w * high_idx
													__lowerCamelCase					:		str		   =     t.reshape(sigma.shape    )
													return t






						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			List[Any]							,					UpperCAmelCase      :			List[str]    ):
													__lowerCamelCase					:		Dict		   =     in_sigmas[-1].item()
													__lowerCamelCase					:		int		   =     in_sigmas[0].item()

													__lowerCamelCase					:		Dict		   =     7.0  # 7.0 is the value used in the paper
													__lowerCamelCase					:		List[Any]		   =     np.linspace(0							,					1							,					UpperCAmelCase    )
													__lowerCamelCase					:		Tuple		   =     sigma_min ** (1 / rho)
													__lowerCamelCase					:		int		   =     sigma_max ** (1 / rho)
													__lowerCamelCase					:		Tuple		   =     (max_inv_rho + ramp * (min_inv_rho - max_inv_rho)) ** rho
													return sigmas






						@property
						def       lowerCamelCase__     (       self      :			Any    ):
													return self.dt is None






						def       lowerCamelCase__     (       self      :			List[str]							,					UpperCAmelCase      :			Union[str, Any]							,					UpperCAmelCase      :			Dict							,					UpperCAmelCase      :			List[str]							,					UpperCAmelCase      :			List[Any] = True							,					):
													__lowerCamelCase					:		List[Any]		   =     self.index_for_timestep(UpperCAmelCase    )

													# advance index counter by 1
													__lowerCamelCase					:		Dict		   =     timestep.cpu().item() if torch.is_tensor(UpperCAmelCase    ) else timestep
													self._index_counter[timestep_int] += 1

													if self.state_in_first_order:
																				__lowerCamelCase					:		Tuple		   =     self.sigmas[step_index]
																				__lowerCamelCase					:		List[Any]		   =     self.sigmas[step_index + 1]
													else:
																				# 2nd order / Heun's method
																				__lowerCamelCase					:		int		   =     self.sigmas[step_index - 1]
																				__lowerCamelCase					:		Optional[Any]		   =     self.sigmas[step_index]

													# currently only gamma=0 is supported. This usually works best anyways.
													# We can support gamma in the future but then need to scale the timestep before
													# passing it to the model which requires a change in API
													__lowerCamelCase					:		int		   =     0
													__lowerCamelCase					:		List[str]		   =     sigma * (gamma + 1)  # Note: sigma_hat == sigma for now

													# 1. compute predicted original sample (x_0) from sigma-scaled predicted noise
													if self.config.prediction_type == "epsilon":
																				__lowerCamelCase					:		Tuple		   =     sigma_hat if self.state_in_first_order else sigma_next
																				__lowerCamelCase					:		Any		   =     sample - sigma_input * model_output
													elif self.config.prediction_type == "v_prediction":
																				__lowerCamelCase					:		Tuple		   =     sigma_hat if self.state_in_first_order else sigma_next
																				__lowerCamelCase					:		Optional[int]		   =     model_output * (-sigma_input / (sigma_input**2 + 1) ** 0.5) + (
																				    sample / (sigma_input**2 + 1)
																				)
													elif self.config.prediction_type == "sample":
																				__lowerCamelCase					:		Any		   =     model_output
													else:
																				raise ValueError(
																				    F"""prediction_type given as {self.config.prediction_type} must be one of `epsilon`, or `v_prediction`"""    )

													if self.config.clip_sample:
																				__lowerCamelCase					:		Optional[int]		   =     pred_original_sample.clamp(
																				    -self.config.clip_sample_range							,					self.config.clip_sample_range    )

													if self.state_in_first_order:
																				# 2. Convert to an ODE derivative for 1st order
																				__lowerCamelCase					:		Union[str, Any]		   =     (sample - pred_original_sample) / sigma_hat
																				# 3. delta timestep
																				__lowerCamelCase					:		Dict		   =     sigma_next - sigma_hat

																				# store for 2nd order step
																				__lowerCamelCase					:		int		   =     derivative
																				__lowerCamelCase					:		Any		   =     dt
																				__lowerCamelCase					:		Optional[Any]		   =     sample
													else:
																				# 2. 2nd order / Heun's method
																				__lowerCamelCase					:		int		   =     (sample - pred_original_sample) / sigma_next
																				__lowerCamelCase					:		Union[str, Any]		   =     (self.prev_derivative + derivative) / 2

																				# 3. take prev timestep & sample
																				__lowerCamelCase					:		List[Any]		   =     self.dt
																				__lowerCamelCase					:		Any		   =     self.sample

																				# free dt and derivative
																				# Note, this puts the scheduler in "first order mode"
																				__lowerCamelCase					:		Tuple		   =     None
																				__lowerCamelCase					:		str		   =     None
																				__lowerCamelCase					:		Optional[int]		   =     None

													__lowerCamelCase					:		Union[str, Any]		   =     sample + derivative * dt

													if not return_dict:
																				return (prev_sample,)

													return SchedulerOutput(prev_sample=UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			Union[str, Any]							,					UpperCAmelCase      :			Optional[int]							,					UpperCAmelCase      :			Tuple							,					UpperCAmelCase      :			Union[str, Any]							,					):
													__lowerCamelCase					:		int		   =     self.sigmas.to(device=original_samples.device							,					dtype=original_samples.dtype    )
													if original_samples.device.type == "mps" and torch.is_floating_point(UpperCAmelCase    ):
																				# mps does not support float64
																				__lowerCamelCase					:		List[str]		   =     self.timesteps.to(original_samples.device							,					dtype=torch.floataa    )
																				__lowerCamelCase					:		int		   =     timesteps.to(original_samples.device							,					dtype=torch.floataa    )
													else:
																				__lowerCamelCase					:		Optional[Any]		   =     self.timesteps.to(original_samples.device    )
																				__lowerCamelCase					:		int		   =     timesteps.to(original_samples.device    )

													__lowerCamelCase					:		str		   =     [self.index_for_timestep(UpperCAmelCase							,					UpperCAmelCase    ) for t in timesteps]

													__lowerCamelCase					:		Dict		   =     sigmas[step_indices].flatten()
													while len(sigma.shape    ) < len(original_samples.shape    ):
																				__lowerCamelCase					:		Dict		   =     sigma.unsqueeze(-1    )

													__lowerCamelCase					:		Optional[Any]		   =     original_samples + noise * sigma
													return noisy_samples







						def __len__(       self      :			Dict    ):
													return self.config.num_train_timesteps
"""simple docstring"""





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_funnel import FunnelTokenizer


__A  =				logging.get_logger(__name__)

__A  =				{'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

__A  =				[
    '''small''',
    '''small-base''',
    '''medium''',
    '''medium-base''',
    '''intermediate''',
    '''intermediate-base''',
    '''large''',
    '''large-base''',
    '''xlarge''',
    '''xlarge-base''',
]

__A  =				{
    '''vocab_file''': {
        '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt''',
        '''funnel-transformer/small-base''': '''https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt''',
        '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt''',
        '''funnel-transformer/medium-base''': (
            '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/intermediate''': (
            '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/intermediate-base''': (
            '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt''',
        '''funnel-transformer/large-base''': '''https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt''',
        '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt''',
        '''funnel-transformer/xlarge-base''': (
            '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt'''
        ),
    },
    '''tokenizer_file''': {
        '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/tokenizer.json''',
        '''funnel-transformer/small-base''': (
            '''https://huggingface.co/funnel-transformer/small-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/tokenizer.json''',
        '''funnel-transformer/medium-base''': (
            '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/intermediate''': (
            '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/intermediate-base''': (
            '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/tokenizer.json''',
        '''funnel-transformer/large-base''': (
            '''https://huggingface.co/funnel-transformer/large-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/tokenizer.json''',
        '''funnel-transformer/xlarge-base''': (
            '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/tokenizer.json'''
        ),
    },
}
__A  =				{F"""funnel-transformer/{name}""": 512 for name in _model_names}
__A  =				{F"""funnel-transformer/{name}""": {'''do_lower_case''': True} for name in _model_names}
class  _snake_case     (					a__		):
						snake_case__			  =			VOCAB_FILES_NAMES
						snake_case__			  =			PRETRAINED_VOCAB_FILES_MAP
						snake_case__			  =			PRETRAINED_INIT_CONFIGURATION
						snake_case__			  =			FunnelTokenizer
						snake_case__			  =			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
						snake_case__			  =			2






						def __init__(       self      :			List[Any]							,					UpperCAmelCase      :			List[str]=None							,					UpperCAmelCase      :			Optional[int]=None							,					UpperCAmelCase      :			List[Any]=True							,					UpperCAmelCase      :			int="<unk>"							,					UpperCAmelCase      :			List[Any]="<sep>"							,					UpperCAmelCase      :			List[str]="<pad>"							,					UpperCAmelCase      :			Union[str, Any]="<cls>"							,					UpperCAmelCase      :			int="<mask>"							,					UpperCAmelCase      :			List[str]="<s>"							,					UpperCAmelCase      :			Union[str, Any]="</s>"							,					UpperCAmelCase      :			List[Any]=True							,					UpperCAmelCase      :			Tuple=True							,					UpperCAmelCase      :			int=None							,					UpperCAmelCase      :			int="##"							,					**UpperCAmelCase      :			Dict							,					):
													super().__init__(
													    UpperCAmelCase							,					tokenizer_file=UpperCAmelCase							,					do_lower_case=UpperCAmelCase							,					unk_token=UpperCAmelCase							,					sep_token=UpperCAmelCase							,					pad_token=UpperCAmelCase							,					cls_token=UpperCAmelCase							,					mask_token=UpperCAmelCase							,					bos_token=UpperCAmelCase							,					eos_token=UpperCAmelCase							,					clean_text=UpperCAmelCase							,					tokenize_chinese_chars=UpperCAmelCase							,					strip_accents=UpperCAmelCase							,					wordpieces_prefix=UpperCAmelCase							,					**UpperCAmelCase							,					)

													__lowerCamelCase					:		List[Any]		   =     json.loads(self.backend_tokenizer.normalizer.__getstate__()    )
													if (
													    normalizer_state.get("lowercase"							,					UpperCAmelCase    ) != do_lower_case
													    or normalizer_state.get("strip_accents"							,					UpperCAmelCase    ) != strip_accents
													    or normalizer_state.get("handle_chinese_chars"							,					UpperCAmelCase    ) != tokenize_chinese_chars
													):
																				__lowerCamelCase					:		Tuple		   =     getattr(UpperCAmelCase							,					normalizer_state.pop("type"    )    )
																				__lowerCamelCase					:		Optional[int]		   =     do_lower_case
																				__lowerCamelCase					:		Union[str, Any]		   =     strip_accents
																				__lowerCamelCase					:		Optional[Any]		   =     tokenize_chinese_chars
																				__lowerCamelCase					:		Optional[Any]		   =     normalizer_class(**UpperCAmelCase    )

													__lowerCamelCase					:		List[Any]		   =     do_lower_case






						def       lowerCamelCase__     (       self      :			Union[str, Any]							,					UpperCAmelCase      :			Union[str, Any]							,					UpperCAmelCase      :			Tuple=None    ):
													__lowerCamelCase					:		List[Any]		   =     [self.cls_token_id] + token_ids_a + [self.sep_token_id]

													if token_ids_a:
																				output += token_ids_a + [self.sep_token_id]

													return output






						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			List[int]							,					UpperCAmelCase      :			Optional[List[int]] = None    ):
													__lowerCamelCase					:		Tuple		   =     [self.sep_token_id]
													__lowerCamelCase					:		int		   =     [self.cls_token_id]
													if token_ids_a is None:
																				return len(cls    ) * [self.cls_token_type_id] + len(token_ids_a + sep    ) * [0]
													return len(cls    ) * [self.cls_token_type_id] + len(token_ids_a + sep    ) * [0] + len(token_ids_a + sep    ) * [1]







						def       lowerCamelCase__     (       self      :			Tuple							,					UpperCAmelCase      :			str							,					UpperCAmelCase      :			Optional[str] = None    ):
													__lowerCamelCase					:		List[Any]		   =     self._tokenizer.model.save(UpperCAmelCase							,					name=UpperCAmelCase    )
													return tuple(UpperCAmelCase    )