


"""simple docstring"""


import json
import os
import unittest

from transformers import AutoTokenizer, GPTaTokenizer, GPTaTokenizerFast
from transformers.models.gpta.tokenization_gpta import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin
@require_tokenizers
class snake_case      (  _UpperCamelCase     ,				unittest.TestCase):
		__UpperCamelCase           =			GPTaTokenizer
		__UpperCamelCase           =			GPTaTokenizerFast
		__UpperCamelCase           =			True
		__UpperCamelCase           =			{'add_prefix_space': True}
		__UpperCamelCase           =			False







		def  a_ (					self      :       Tuple		)       ->						Optional[Any]:





						'''simple docstring'''







						super().setUp()

						# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
						_A					  =			[
						    "l",
						    "o",
						    "w",
						    "e",
						    "r",
						    "s",
						    "t",
						    "i",
						    "d",
						    "n",
						    "\u0120",
						    "\u0120l",
						    "\u0120n",
						    "\u0120lo",
						    "\u0120low",
						    "er",
						    "\u0120lowest",
						    "\u0120newer",
						    "\u0120wider",
						    "<unk>",
						    "<|endoftext|>",
						]
						_A					  =			dict(zip(a__    ,   range(len(a__		)		)		)		)
						_A					  =			["#version: 0.2", "\u0120 l", "\u0120l o", "\u0120lo w", "e r", ""]
						_A					  =			{"unk_token": "<unk>"}

						_A					  =			os.path.join(self.tmpdirname    ,   VOCAB_FILES_NAMES["vocab_file"]		)
						_A					  =			os.path.join(self.tmpdirname    ,   VOCAB_FILES_NAMES["merges_file"]		)
						with open(self.vocab_file    ,   "w"    ,   encoding="utf-8"		) as fp:
										fp.write(json.dumps(a__		) + "\n"		)
						with open(self.merges_file    ,   "w"    ,   encoding="utf-8"		) as fp:
										fp.write("\n".join(a__		)		)







		def  a_ (					self      :       str    ,   **a__      :       str		)       ->						Any:





						'''simple docstring'''







						kwargs.update(self.special_tokens_map		)
						return GPTaTokenizer.from_pretrained(self.tmpdirname    ,   **a__		)







		def  a_ (					self      :       str    ,   **a__      :       Dict		)       ->						List[str]:





						'''simple docstring'''







						kwargs.update(self.special_tokens_map		)
						return GPTaTokenizerFast.from_pretrained(self.tmpdirname    ,   **a__		)







		def  a_ (					self      :       int    ,   a__      :       int		)       ->						Tuple:





						'''simple docstring'''







						_A					  =			"lower newer"
						_A					  =			"lower newer"
						return input_text, output_text







		def  a_ (					self      :       str		)       ->						Optional[Any]:





						'''simple docstring'''







						_A					  =			GPTaTokenizer(self.vocab_file    ,   self.merges_file    ,   **self.special_tokens_map		)
						_A					  =			"lower newer"
						_A					  =			["\u0120low", "er", "\u0120", "n", "e", "w", "er"]
						_A					  =			tokenizer.tokenize(a__    ,   add_prefix_space=a__		)
						self.assertListEqual(a__    ,   a__		)

						_A					  =			tokens + [tokenizer.unk_token]
						_A					  =			[14, 15, 10, 9, 3, 2, 15, 19]
						self.assertListEqual(tokenizer.convert_tokens_to_ids(a__		)    ,   a__		)







		def  a_ (					self      :       List[str]		)       ->						Tuple:





						'''simple docstring'''







						if not self.test_rust_tokenizer:
										return

						_A					  =			self.get_tokenizer()
						_A					  =			self.get_rust_tokenizer(add_prefix_space=a__		)

						_A					  =			"lower newer"

						# Testing tokenization
						_A					  =			tokenizer.tokenize(a__    ,   add_prefix_space=a__		)
						_A					  =			rust_tokenizer.tokenize(a__		)
						self.assertListEqual(a__    ,   a__		)

						# Testing conversion to ids without special tokens
						_A					  =			tokenizer.encode(a__    ,   add_special_tokens=a__    ,   add_prefix_space=a__		)
						_A					  =			rust_tokenizer.encode(a__    ,   add_special_tokens=a__		)
						self.assertListEqual(a__    ,   a__		)

						# Testing conversion to ids with special tokens
						_A					  =			self.get_rust_tokenizer(add_prefix_space=a__		)
						_A					  =			tokenizer.encode(a__    ,   add_prefix_space=a__		)
						_A					  =			rust_tokenizer.encode(a__		)
						self.assertListEqual(a__    ,   a__		)

						# Testing the unknown token
						_A					  =			tokens + [rust_tokenizer.unk_token]
						_A					  =			[14, 15, 10, 9, 3, 2, 15, 19]
						self.assertListEqual(rust_tokenizer.convert_tokens_to_ids(a__		)    ,   a__		)







		def  a_ (					self      :       List[str]    ,   *a__      :       Any    ,   **a__      :       List[Any]		)       ->						List[str]:





						'''simple docstring'''







						pass







		def  a_ (					self      :       Any    ,   a__      :       List[str]=15		)       ->						str:





						'''simple docstring'''







						for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
										with self.subTest(F"""{tokenizer.__class__.__name__} ({pretrained_name})"""		):
														_A					  =			self.rust_tokenizer_class.from_pretrained(a__    ,   **a__		)

														# Simple input
														_A					  =			"This is a simple input"
														_A					  =			["This is a simple input 1", "This is a simple input 2"]
														_A					  =			("This is a simple input", "This is a pair")
														_A					  =			[
														    ("This is a simple input 1", "This is a simple input 2"),
														    ("This is a simple pair 1", "This is a simple pair 2"),
														]

														# Simple input tests
														self.assertRaises(a__    ,   tokenizer_r.encode    ,   a__    ,   max_length=a__    ,   padding="max_length"		)

														# Simple input
														self.assertRaises(a__    ,   tokenizer_r.encode_plus    ,   a__    ,   max_length=a__    ,   padding="max_length"		)

														# Simple input
														self.assertRaises(
														    a__    ,   tokenizer_r.batch_encode_plus    ,   a__    ,   max_length=a__    ,   padding="max_length"    ,   )

														# Pair input
														self.assertRaises(a__    ,   tokenizer_r.encode    ,   a__    ,   max_length=a__    ,   padding="max_length"		)

														# Pair input
														self.assertRaises(a__    ,   tokenizer_r.encode_plus    ,   a__    ,   max_length=a__    ,   padding="max_length"		)

														# Pair input
														self.assertRaises(
														    a__    ,   tokenizer_r.batch_encode_plus    ,   a__    ,   max_length=a__    ,   padding="max_length"    ,   )







		def  a_ (					self      :       List[str]		)       ->						Any:





						'''simple docstring'''







						_A					  =			GPTaTokenizer.from_pretrained(self.tmpdirname    ,   pad_token="<pad>"		)

						# Simple input
						_A					  =			"This is a simple input"
						_A					  =			["This is a simple input looooooooong", "This is a simple input"]
						_A					  =			("This is a simple input", "This is a pair")
						_A					  =			[
						    ("This is a simple input loooooong", "This is a simple input"),
						    ("This is a simple pair loooooong", "This is a simple pair"),
						]

						_A					  =			tokenizer.pad_token_id

						_A					  =			tokenizer(a__    ,   padding="max_length"    ,   max_length=30    ,   return_tensors="np"		)
						_A					  =			tokenizer(a__    ,   padding=a__    ,   truncate=a__    ,   return_tensors="np"		)
						_A					  =			tokenizer(*a__    ,   padding="max_length"    ,   max_length=60    ,   return_tensors="np"		)
						_A					  =			tokenizer(a__    ,   padding=a__    ,   truncate=a__    ,   return_tensors="np"		)

						# s
						# test single string max_length padding
						self.assertEqual(out_s["input_ids"].shape[-1]    ,   30		)
						self.assertTrue(pad_token_id in out_s["input_ids"]		)
						self.assertTrue(0 in out_s["attention_mask"]		)

						# s2
						# test automatic padding
						self.assertEqual(out_sa["input_ids"].shape[-1]    ,   33		)
						# long slice doesn't have padding
						self.assertFalse(pad_token_id in out_sa["input_ids"][0]		)
						self.assertFalse(0 in out_sa["attention_mask"][0]		)
						# short slice does have padding
						self.assertTrue(pad_token_id in out_sa["input_ids"][1]		)
						self.assertTrue(0 in out_sa["attention_mask"][1]		)

						# p
						# test single pair max_length padding
						self.assertEqual(out_p["input_ids"].shape[-1]    ,   60		)
						self.assertTrue(pad_token_id in out_p["input_ids"]		)
						self.assertTrue(0 in out_p["attention_mask"]		)

						# p2
						# test automatic padding pair
						self.assertEqual(out_pa["input_ids"].shape[-1]    ,   52		)
						# long slice pair doesn't have padding
						self.assertFalse(pad_token_id in out_pa["input_ids"][0]		)
						self.assertFalse(0 in out_pa["attention_mask"][0]		)
						# short slice pair does have padding
						self.assertTrue(pad_token_id in out_pa["input_ids"][1]		)
						self.assertTrue(0 in out_pa["attention_mask"][1]		)







		def  a_ (					self      :       Optional[int]		)       ->						Any:





						'''simple docstring'''







						_A					  =			"$$$"
						_A					  =			GPTaTokenizer.from_pretrained(self.tmpdirname    ,   bos_token=a__    ,   add_bos_token=a__		)

						_A					  =			"This is a simple input"
						_A					  =			["This is a simple input 1", "This is a simple input 2"]

						_A					  =			tokenizer.bos_token_id

						_A					  =			tokenizer(a__		)
						_A					  =			tokenizer(a__		)

						self.assertEqual(out_s.input_ids[0]    ,   a__		)
						self.assertTrue(all(o[0] == bos_token_id for o in out_sa.input_ids		)		)

						_A					  =			tokenizer.decode(out_s.input_ids		)
						_A					  =			tokenizer.batch_decode(out_sa.input_ids		)

						self.assertEqual(decode_s.split()[0]    ,   a__		)
						self.assertTrue(all(d.split()[0] == bos_token for d in decode_sa		)		)







		def  a_ (					self      :       Optional[Any]		)       ->						Optional[Any]:





						'''simple docstring'''







						pass







		def  a_ (					self      :       List[str]		)       ->						List[Any]:





						'''simple docstring'''







						_A					  =			[self.get_tokenizer(do_lower_case=a__    ,   add_bos_token=a__		)]
						for tokenizer in tokenizers:
										with self.subTest(F"""{tokenizer.__class__.__name__}"""		):
														_A					  =			"Encode this."
														_A					  =			"This one too please."
														_A					  =			tokenizer.encode(a__    ,   add_special_tokens=a__		)
														encoded_sequence += tokenizer.encode(a__    ,   add_special_tokens=a__		)
														_A					  =			tokenizer.encode_plus(
														    a__    ,   a__    ,   add_special_tokens=a__    ,   return_special_tokens_mask=a__    ,   )
														_A					  =			encoded_sequence_dict["input_ids"]
														_A					  =			encoded_sequence_dict["special_tokens_mask"]
														self.assertEqual(len(a__		)    ,   len(a__		)		)

														_A					  =			[
														    (x if not special_tokens_mask[i] else None) for i, x in enumerate(a__		)
														]
														_A					  =			[x for x in filtered_sequence if x is not None]
														self.assertEqual(a__    ,   a__		)





@require_tokenizers
class snake_case      (  unittest.TestCase):







		def  a_ (					self      :       Tuple		)       ->						Tuple:





						'''simple docstring'''







						_A					  =			AutoTokenizer.from_pretrained("facebook/opt-350m"    ,   from_slow=a__		)
						_A					  =			"A photo of a cat"

						_A					  =			tokenizer.encode(
						    a__    ,   )
						self.assertEqual(a__    ,   [2, 2_50, 13_45, 9, 10, 47_58]		)
						tokenizer.save_pretrained("test_opt"		)

						_A					  =			AutoTokenizer.from_pretrained("./test_opt"		)
						_A					  =			tokenizer.encode(
						    a__    ,   )
						self.assertEqual(a__    ,   [2, 2_50, 13_45, 9, 10, 47_58]		)







		def  a_ (					self      :       int		)       ->						Union[str, Any]:





						'''simple docstring'''







						_A					  =			AutoTokenizer.from_pretrained("facebook/opt-350m"    ,   use_slow=a__		)
						_A					  =			"A photo of a cat"

						_A					  =			tokenizer.encode(
						    a__    ,   )
						# Same as above
						self.assertEqual(a__    ,   [2, 2_50, 13_45, 9, 10, 47_58]		)







		@unittest.skip("This test is failing because of a bug in the fast tokenizer"		)
		def  a_ (					self      :       List[str]		)       ->						Dict:





						'''simple docstring'''







						_A					  =			AutoTokenizer.from_pretrained("facebook/opt-350m"    ,   from_slow=a__		)

						_A					  =			"bos"
						_A					  =			tokenizer.get_vocab()["bos"]

						_A					  =			"A photo of a cat"
						_A					  =			tokenizer.encode(
						    a__    ,   )
						# We changed the bos token
						self.assertEqual(a__    ,   [3_19_57, 2_50, 13_45, 9, 10, 47_58]		)
						tokenizer.save_pretrained("./tok"		)
						_A					  =			AutoTokenizer.from_pretrained("./tok"		)
						self.assertTrue(tokenizer.is_fast		)
						_A					  =			tokenizer.encode(
						    a__    ,   )
						self.assertEqual(a__    ,   [3_19_57, 2_50, 13_45, 9, 10, 47_58]		)



"""simple docstring"""


import os
import re
import warnings
from shutil import copyfile
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer


if TYPE_CHECKING:
		from ...tokenization_utils_base import TextInput
from ...utils import logging


a_       							=    logging.get_logger(__name__)

a_       							=    {"vocab_file": "spiece.model"}

a_       							=    {
    "vocab_file": {
        "t5-small": "https://huggingface.co/t5-small/resolve/main/spiece.model",
        "t5-base": "https://huggingface.co/t5-base/resolve/main/spiece.model",
        "t5-large": "https://huggingface.co/t5-large/resolve/main/spiece.model",
        "t5-3b": "https://huggingface.co/t5-3b/resolve/main/spiece.model",
        "t5-11b": "https://huggingface.co/t5-11b/resolve/main/spiece.model",
    }
}


# TODO(PVP) - this should be removed in Transformers v5
a_       							=    {
    "t5-small": 5_12,
    "t5-base": 5_12,
    "t5-large": 5_12,
    "t5-3b": 5_12,
    "t5-11b": 5_12,
}

a_       							=    "▁"
class snake_case      (  _UpperCamelCase):
		__UpperCamelCase           =			VOCAB_FILES_NAMES
		__UpperCamelCase           =			PRETRAINED_VOCAB_FILES_MAP
		__UpperCamelCase           =			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		__UpperCamelCase           =			['input_ids', 'attention_mask']







		def __init__(					self      :       List[str]    ,   a__      :       Optional[int]    ,   a__      :       Union[str, Any]="</s>"    ,   a__      :       Union[str, Any]="<unk>"    ,   a__      :       str="<pad>"    ,   a__      :       Optional[int]=1_00    ,   a__      :       List[Any]=None    ,   a__      :       Optional[Dict[str, Any]] = None    ,   a__      :       Any=True    ,   **a__      :       Optional[int]    ,   )       ->						None:





						'''simple docstring'''







						if extra_ids > 0 and additional_special_tokens is None:
										_A					  =			[F"""<extra_id_{i}>""" for i in range(a__		)]
						elif extra_ids > 0 and additional_special_tokens is not None:
										# Check that we have the right number of extra_id special tokens
										_A					  =			len(set(filter(lambda a__		: bool("extra_id" in str(a__		)		)    ,   a__		)		)		)
										if extra_tokens != extra_ids:
														raise ValueError(
														    F"""Both extra_ids ({extra_ids}) and additional_special_tokens ({additional_special_tokens}) are"""
														    " provided to T5Tokenizer. In this case the additional_special_tokens must include the extra_ids"
														    " tokens"		)
						if legacy:
										logger.warning_once(
										    F"""You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to"""
										    " read the related pull request available at https://github.com/huggingface/transformers/pull/24565"		)

						_A					  =			legacy
						_A					  =			{} if sp_model_kwargs is None else sp_model_kwargs

						super().__init__(
						    eos_token=a__    ,   unk_token=a__    ,   pad_token=a__    ,   extra_ids=a__    ,   additional_special_tokens=a__    ,   sp_model_kwargs=self.sp_model_kwargs    ,   legacy=a__    ,   **a__    ,   )

						_A					  =			vocab_file
						_A					  =			extra_ids

						_A					  =			spm.SentencePieceProcessor(**self.sp_model_kwargs		)
						self.sp_model.Load(a__		)







		@staticmethod
		def  a_ (					a__      :       List[str]    ,   a__      :       Optional[int]    ,   a__      :       Tuple		)       ->						Tuple:





						'''simple docstring'''







						if pretrained_model_name_or_path in TaTokenizer.max_model_input_sizes:
										_A					  =			TaTokenizer.max_model_input_sizes[pretrained_model_name_or_path]
										if init_max_model_length is not None and init_max_model_length != max_model_length:
														return init_max_model_length
										elif init_max_model_length is None:
														warnings.warn(
														    "This tokenizer was incorrectly instantiated with a model max length of"
														    F""" {deprecated_max_model_length} which will be corrected in Transformers v5.\nFor now, this"""
														    " behavior is kept to avoid breaking backwards compatibility when padding/encoding with"
														    " `truncation is True`.\n- Be aware that you SHOULD NOT rely on"
														    F""" {pretrained_model_name_or_path} automatically truncating your input to"""
														    F""" {deprecated_max_model_length} when padding/encoding.\n- If you want to encode/pad to sequences"""
														    F""" longer than {deprecated_max_model_length} you can either instantiate this tokenizer with"""
														    " `model_max_length` or pass `max_length` when encoding/padding.\n- To avoid this warning, please"
														    " instantiate this tokenizer with `model_max_length` set to your preferred value."    ,   a__    ,   )

						return max_model_length







		@property
		def  a_ (					self      :       List[Any]		)       ->						Dict:





						'''simple docstring'''







						return self.sp_model.get_piece_size() + self._extra_ids







		def  a_ (					self      :       Dict		)       ->						Optional[Any]:





						'''simple docstring'''







						_A					  =			{self.convert_ids_to_tokens(a__		): i for i in range(self.vocab_size		)}
						vocab.update(self.added_tokens_encoder		)
						return vocab







		def  a_ (					self      :       Optional[Any]    ,   a__      :       List[int]    ,   a__      :       Optional[List[int]] = None    ,   a__      :       bool = False		)       ->						List[int]:





						'''simple docstring'''







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

						# normal case: some special tokens
						if token_ids_a is None:
										return ([0] * len(a__		)) + [1]
						return ([0] * len(a__		)) + [1] + ([0] * len(a__		)) + [1]







		def  a_ (					self      :       List[str]		)       ->						List[str]:





						'''simple docstring'''







						return list(
						    set(filter(lambda a__		: bool(re.search(r"<extra_id_\d+>"    ,   a__		)		) is not None    ,   self.additional_special_tokens		)		)		)







		def  a_ (					self      :       str		)       ->						List[Any]:





						'''simple docstring'''







						return [self._convert_token_to_id(a__		) for token in self.get_sentinel_tokens()]







		def  a_ (					self      :       List[Any]    ,   a__      :       List[int]		)       ->						List[int]:





						'''simple docstring'''







						if len(a__		) > 0 and token_ids[-1] == self.eos_token_id:
										warnings.warn(
										    F"""This sequence already has {self.eos_token}. In future versions this behavior may lead to duplicated"""
										    " eos tokens being added."		)
										return token_ids
						else:
										return token_ids + [self.eos_token_id]







		def  a_ (					self      :       int    ,   a__      :       List[int]    ,   a__      :       Optional[List[int]] = None		)       ->						List[int]:





						'''simple docstring'''







						_A					  =			[self.eos_token_id]

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







		def  a_ (					self      :       Union[str, Any]    ,   a__      :       List[int]    ,   a__      :       Optional[List[int]] = None		)       ->						List[int]:





						'''simple docstring'''







						_A					  =			self._add_eos_if_not_present(a__		)
						if token_ids_a is None:
										return token_ids_a
						else:
										_A					  =			self._add_eos_if_not_present(a__		)
										return token_ids_a + token_ids_a







		def __getstate__(					self      :       Dict		)       ->						Union[str, Any]:





						'''simple docstring'''







						_A					  =			self.__dict__.copy()
						_A					  =			None
						return state







		def __setstate__(					self      :       int    ,   a__      :       Optional[int]		)       ->						Union[str, Any]:





						'''simple docstring'''







						_A					  =			d

						# for backward compatibility
						if not hasattr(self    ,   "sp_model_kwargs"		):
										_A					  =			{}

						_A					  =			spm.SentencePieceProcessor(**self.sp_model_kwargs		)
						self.sp_model.Load(self.vocab_file		)







		def  a_ (					self      :       int    ,   a__      :       "TextInput"    ,   **a__      :       List[str]		)       ->						List[str]:





						'''simple docstring'''







						if not self.legacy:
										_A					  =			SPIECE_UNDERLINE + text.replace(a__    ,   " "		)
						return super().tokenize(a__    ,   **a__		)







		def  a_ (					self      :       str    ,   a__      :       Dict    ,   **a__      :       Optional[int]		)       ->						Any:





						'''simple docstring'''







						if not self.legacy:
										_A					  =			text.startswith(a__		)
										if is_first:
														_A					  =			text[1:]

						_A					  =			self.sp_model.encode(a__    ,   out_type=a__		)

						if not self.legacy and not is_first and not text.startswith(" "		) and tokens[0].startswith(a__		):
										_A					  =			([tokens[0][1:]] if len(tokens[0]		) > 1 else []) + tokens[1:]
						return tokens







		def  a_ (					self      :       int    ,   a__      :       List[Any]		)       ->						List[str]:





						'''simple docstring'''







						if token.startswith("<extra_id_"		):
										_A					  =			re.match(r"<extra_id_(\d+)>"    ,   a__		)
										_A					  =			int(match.group(1		)		)
										return self.vocab_size - num - 1
						return self.sp_model.piece_to_id(a__		)







		def  a_ (					self      :       Dict    ,   a__      :       Union[str, Any]		)       ->						Any:





						'''simple docstring'''







						if index < self.sp_model.get_piece_size():
										_A					  =			self.sp_model.IdToPiece(a__		)
						else:
										_A					  =			F"""<extra_id_{self.vocab_size - 1 - index}>"""
						return token







		def  a_ (					self      :       Optional[int]    ,   a__      :       Tuple		)       ->						List[str]:





						'''simple docstring'''







						_A					  =			[]
						_A					  =			""
						_A					  =			False
						for token in tokens:
										# make sure that special tokens are not decoded using sentencepiece model
										if token in self.all_special_tokens:
														if not prev_is_special:
																		out_string += " "
														out_string += self.sp_model.decode(a__		) + token
														_A					  =			True
														_A					  =			[]
										else:
														current_sub_tokens.append(a__		)
														_A					  =			False
						out_string += self.sp_model.decode(a__		)
						return out_string.strip()







		def  a_ (					self      :       Dict    ,   a__      :       str    ,   a__      :       Optional[str] = None		)       ->						Tuple[str]:





						'''simple docstring'''







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

						if os.path.abspath(self.vocab_file		) != os.path.abspath(a__		) and os.path.isfile(self.vocab_file		):
										copyfile(self.vocab_file    ,   a__		)
						elif not os.path.isfile(self.vocab_file		):
										with open(a__    ,   "wb"		) as fi:
														_A					  =			self.sp_model.serialized_model_proto()
														fi.write(a__		)

						return (out_vocab_file,)