






"""simple docstring"""
import os
import sys
import warnings
from dataclasses import dataclass, field
from io import BytesIO
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Union

import numpy as np
import pyarrow as pa

from .. import config
from ..download.streaming_download_manager import xopen
from ..table import array_cast
from ..utils.file_utils import is_local_path
from ..utils.py_utils import first_non_null_value, no_op_if_value_is_null, string_to_dict


if TYPE_CHECKING:
			import PIL.Image

			from .features import FeatureType


lowerCamelCase_					=      None
lowerCamelCase_					=      '''<''' if sys.byteorder == '''little''' else '''>'''
# Origin: https://github.com/python-pillow/Pillow/blob/698951e19e19972aeed56df686868f1329981c12/src/PIL/Image.py#L3126 minus "|i1" which values are not preserved correctly when saving and loading an image
lowerCamelCase_					=      [
    np.dtype('''|b1'''),
    np.dtype('''|u1'''),
    np.dtype('''<u2'''),
    np.dtype('''>u2'''),
    np.dtype('''<i2'''),
    np.dtype('''>i2'''),
    np.dtype('''<u4'''),
    np.dtype('''>u4'''),
    np.dtype('''<i4'''),
    np.dtype('''>i4'''),
    np.dtype('''<f4'''),
    np.dtype('''>f4'''),
    np.dtype('''<f8'''),
    np.dtype('''>f8'''),
]







@dataclass
class 			UpperCamelCase_       :
	__magic_name__	      =				True
	__magic_name__	      =				None
	# Automatically constructed
	__magic_name__	      =				"PIL.Image.Image"
	__magic_name__	      =				pa.struct({'''bytes''': pa.binary(), '''path''': pa.string()}     )
	__magic_name__	      =				field(default='''Image'''				,						init=__A				,						repr=__A     )





	def __call__(      self					: Optional[Any]						)						->			str:
				return self.pa_type





	def      _SCREAMING_SNAKE_CASE      (      self					: Optional[int]	,	lowerCAmelCase_					: Union[str, bytes, dict, np.ndarray, "PIL.Image.Image"]						)						->			dict:
				if config.PIL_AVAILABLE:
							import PIL.Image
				else:
							raise ImportError("To support encoding images, please install 'Pillow'."						)

				if isinstance(lowerCAmelCase_	,	lowerCAmelCase_						):
							UpperCAmelCase_     : List[Any]			     =					np.array(lowerCAmelCase_						)

				if isinstance(lowerCAmelCase_	,	lowerCAmelCase_						):
							return {"path": value, "bytes": None}
				elif isinstance(lowerCAmelCase_	,	lowerCAmelCase_						):
							return {"path": None, "bytes": value}
				elif isinstance(lowerCAmelCase_	,	np.ndarray						):
							# convert the image array to PNG/TIFF bytes
							return encode_np_array(lowerCAmelCase_						)
				elif isinstance(lowerCAmelCase_	,	PIL.Image.Image						):
							# convert the PIL image to bytes (default format is PNG/TIFF)
							return encode_pil_image(lowerCAmelCase_						)
				elif value.get("path"						) is not None and os.path.isfile(value["path"]						):
							# we set "bytes": None to not duplicate the data if they're already available locally
							return {"bytes": None, "path": value.get("path"						)}
				elif value.get("bytes"						) is not None or value.get("path"						) is not None:
							# store the image bytes, and path is used to infer the image format using the file extension
							return {"bytes": value.get("bytes"						), "path": value.get("path"						)}
				else:
							raise ValueError(
							    f"""An image sample should have one of 'path' or 'bytes' but they are missing or None in {value}."""						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Union[str, Any]	,	lowerCAmelCase_					: dict	,	lowerCAmelCase_					: Union[str, Any]=None						)						->			"PIL.Image.Image":
				if not self.decode:
							raise RuntimeError("Decoding is disabled for this feature. Please use Image(decode=True) instead."						)

				if config.PIL_AVAILABLE:
							import PIL.Image
				else:
							raise ImportError("To support decoding images, please install 'Pillow'."						)

				if token_per_repo_id is None:
							UpperCAmelCase_     : int			     =					{}

				UpperCAmelCase_     ,	UpperCAmelCase_     : Optional[Any]			     =					value["path"], value["bytes"]
				if bytes_ is None:
							if path is None:
										raise ValueError(f"""An image should have one of 'path' or 'bytes' but both are None in {value}."""						)
							else:
										if is_local_path(lowerCAmelCase_						):
													UpperCAmelCase_     : List[Any]			     =					PIL.Image.open(lowerCAmelCase_						)
										else:
													UpperCAmelCase_     : int			     =					path.split("::"						)[-1]
													try:
																UpperCAmelCase_     : Optional[Any]			     =					string_to_dict(lowerCAmelCase_	,	config.HUB_DATASETS_URL						)["repo_id"]
																UpperCAmelCase_     : List[Any]			     =					token_per_repo_id.get(lowerCAmelCase_						)
													except ValueError:
																UpperCAmelCase_     : Dict			     =					None
													with xopen(lowerCAmelCase_	,	"rb"	,	use_auth_token=lowerCAmelCase_						) as f:
																UpperCAmelCase_     : Optional[Any]			     =					BytesIO(f.read()						)
													UpperCAmelCase_     : List[str]			     =					PIL.Image.open(bytes_						)
				else:
							UpperCAmelCase_     : Optional[int]			     =					PIL.Image.open(BytesIO(bytes_						)						)
				image.load()  # to avoid "Too many open files" errors
				return image





	def      _SCREAMING_SNAKE_CASE      (      self					: str						)						->			Union["FeatureType", Dict[str, "FeatureType"]]:
				from .features import Value

				return (
				    self
				    if self.decode
				    else {
				        "bytes": Value("binary"						),
				        "path": Value("string"						),
				    }
				)





	def      _SCREAMING_SNAKE_CASE      (      self					: List[Any]	,	lowerCAmelCase_					: Union[pa.StringArray, pa.StructArray, pa.ListArray]						)						->			pa.StructArray:
				if pa.types.is_string(storage.type						):
							UpperCAmelCase_     : Union[str, Any]			     =					pa.array([None] * len(lowerCAmelCase_						)	,	type=pa.binary()						)
							UpperCAmelCase_     : List[str]			     =					pa.StructArray.from_arrays([bytes_array, storage]	,	["bytes", "path"]	,	mask=storage.is_null()						)
				elif pa.types.is_binary(storage.type						):
							UpperCAmelCase_     : List[Any]			     =					pa.array([None] * len(lowerCAmelCase_						)	,	type=pa.string()						)
							UpperCAmelCase_     : List[str]			     =					pa.StructArray.from_arrays([storage, path_array]	,	["bytes", "path"]	,	mask=storage.is_null()						)
				elif pa.types.is_struct(storage.type						):
							if storage.type.get_field_index("bytes"						) >= 0:
										UpperCAmelCase_     : str			     =					storage.field("bytes"						)
							else:
										UpperCAmelCase_     : Any			     =					pa.array([None] * len(lowerCAmelCase_						)	,	type=pa.binary()						)
							if storage.type.get_field_index("path"						) >= 0:
										UpperCAmelCase_     : Optional[int]			     =					storage.field("path"						)
							else:
										UpperCAmelCase_     : List[Any]			     =					pa.array([None] * len(lowerCAmelCase_						)	,	type=pa.string()						)
							UpperCAmelCase_     : List[str]			     =					pa.StructArray.from_arrays([bytes_array, path_array]	,	["bytes", "path"]	,	mask=storage.is_null()						)
				elif pa.types.is_list(storage.type						):
							UpperCAmelCase_     : Dict			     =					pa.array(
							    [encode_np_array(np.array(lowerCAmelCase_						)						)["bytes"] if arr is not None else None for arr in storage.to_pylist()]	,	type=pa.binary()	,	)
							UpperCAmelCase_     : str			     =					pa.array([None] * len(lowerCAmelCase_						)	,	type=pa.string()						)
							UpperCAmelCase_     : Any			     =					pa.StructArray.from_arrays(
							    [bytes_array, path_array]	,	["bytes", "path"]	,	mask=bytes_array.is_null()						)
				return array_cast(lowerCAmelCase_	,	self.pa_type						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Union[str, Any]	,	lowerCAmelCase_					: pa.StructArray						)						->			pa.StructArray:

				@no_op_if_value_is_null
				def path_to_bytes(lowerCAmelCase_					: Any						):
							with xopen(lowerCAmelCase_	,	"rb"						) as f:
										UpperCAmelCase_     : Optional[Any]			     =					f.read()
							return bytes_

				UpperCAmelCase_     : Any			     =					pa.array(
				    [
				        (path_to_bytes(x["path"]						) if x["bytes"] is None else x["bytes"]) if x is not None else None
				        for x in storage.to_pylist()
				    ]	,	type=pa.binary()	,	)
				UpperCAmelCase_     : Any			     =					pa.array(
				    [os.path.basename(lowerCAmelCase_						) if path is not None else None for path in storage.field("path"						).to_pylist()]	,	type=pa.string()	,	)
				UpperCAmelCase_     : Optional[int]			     =					pa.StructArray.from_arrays([bytes_array, path_array]	,	["bytes", "path"]	,	mask=bytes_array.is_null()						)
				return array_cast(lowerCAmelCase_	,	self.pa_type						)





def 				snake_case      (   ):
			if config.PIL_AVAILABLE:
						import PIL.Image
			else:
						raise ImportError("To support encoding images, please install 'Pillow'."						)

			global _IMAGE_COMPRESSION_FORMATS
			if _IMAGE_COMPRESSION_FORMATS is None:
						PIL.Image.init()
						UpperCAmelCase_     : List[str]			     =					list(set(PIL.Image.OPEN.keys()						) & set(PIL.Image.SAVE.keys()						)						)
			return _IMAGE_COMPRESSION_FORMATS

def 				snake_case      (   A__						):
			UpperCAmelCase_     : Tuple			     =					BytesIO()
			if image.format in list_image_compression_formats():
						UpperCAmelCase_     : Union[str, Any]			     =					image.format
			else:
						UpperCAmelCase_     : Any			     =					"PNG" if image.mode in ["1", "L", "LA", "RGB", "RGBA"] else "TIFF"
			image.save(A__	,format=A__						)
			return buffer.getvalue()

def 				snake_case      (   A__						):
			if hasattr(A__	,"filename"						) and image.filename != "":
						return {"path": image.filename, "bytes": None}
			else:
						return {"path": None, "bytes": image_to_bytes(A__						)}

def 				snake_case      (   A__						):
			if config.PIL_AVAILABLE:
						import PIL.Image
			else:
						raise ImportError("To support encoding images, please install 'Pillow'."						)

			UpperCAmelCase_     : str			     =					array.dtype
			UpperCAmelCase_     : Union[str, Any]			     =					dtype.byteorder if dtype.byteorder != "=" else _NATIVE_BYTEORDER
			UpperCAmelCase_     : Tuple			     =					dtype.kind
			UpperCAmelCase_     : Union[str, Any]			     =					dtype.itemsize

			UpperCAmelCase_     : Dict			     =					None

			# Multi-channel array case (only np.dtype("|u1") is allowed)
			if array.shape[2:]:
						UpperCAmelCase_     : int			     =					np.dtype("|u1"						)
						if dtype_kind not in ["u", "i"]:
									raise TypeError(
									    F"""Unsupported array dtype {dtype} for image encoding. Only {dest_dtype} is supported for multi-channel arrays."""						)
						if dtype is not dest_dtype:
									warnings.warn(F"""Downcasting array dtype {dtype} to {dest_dtype} to be compatible with 'Pillow'"""						)
    # Exact match
			elif dtype in _VALID_IMAGE_ARRAY_DTPYES:
						UpperCAmelCase_     : List[Any]			     =					dtype
			else:  # Downcast the type within the kind (np.can_cast(from_type, to_type, casting="same_kind") doesn't behave as expected, so do it manually)
						while dtype_itemsize >= 1:
									UpperCAmelCase_     : Optional[Any]			     =					dtype_byteorder + dtype_kind + str(A__						)
									UpperCAmelCase_     : Union[str, Any]			     =					np.dtype(A__						)
									if dest_dtype in _VALID_IMAGE_ARRAY_DTPYES:
												warnings.warn(F"""Downcasting array dtype {dtype} to {dest_dtype} to be compatible with 'Pillow'"""						)
												break
									else:
												dtype_itemsize //= 2

			if dest_dtype is None:
						raise TypeError(
						    F"""Cannot convert dtype {dtype} to a valid image dtype. Valid image dtypes: {_VALID_IMAGE_ARRAY_DTPYES}"""						)
			UpperCAmelCase_     : Tuple			     =					PIL.Image.fromarray(array.astype(A__						)						)
			return {"path": None, "bytes": image_to_bytes(A__						)}




def 				snake_case      (   A__						):
			if config.PIL_AVAILABLE:
						import PIL.Image
			else:
						raise ImportError("To support encoding images, please install 'Pillow'."						)

			if objs:
						UpperCAmelCase_     ,	UpperCAmelCase_     : List[str]			     =					first_non_null_value(A__						)
						if isinstance(A__	,A__						):
									return [{"path": obj, "bytes": None} if obj is not None else None for obj in objs]
						if isinstance(A__	,np.ndarray						):
									UpperCAmelCase_     : List[Any]			     =					no_op_if_value_is_null(A__						)
									return [obj_to_image_dict_func(A__						) for obj in objs]
						elif isinstance(A__	,PIL.Image.Image						):
									UpperCAmelCase_     : Optional[Any]			     =					no_op_if_value_is_null(A__						)
									return [obj_to_image_dict_func(A__						) for obj in objs]
						else:
									return objs
			else:
						return objs











"""simple docstring"""
import os
from shutil import copyfile
from typing import List, Optional, Tuple

from tokenizers import processors

from ...tokenization_utils import AddedToken, BatchEncoding
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
			from .tokenization_mbart import MBartTokenizer
else:
			lowerCamelCase_					=      None


lowerCamelCase_					=      logging.get_logger(__name__)


lowerCamelCase_					=      {'''vocab_file''': '''sentencepiece.bpe.model''', '''tokenizer_file''': '''tokenizer.json'''}

lowerCamelCase_					=      {
    '''vocab_file''': {
        '''facebook/mbart-large-en-ro''': (
            '''https://huggingface.co/facebook/mbart-large-en-ro/resolve/main/sentencepiece.bpe.model'''
        ),
        '''facebook/mbart-large-cc25''': (
            '''https://huggingface.co/facebook/mbart-large-cc25/resolve/main/sentencepiece.bpe.model'''
        ),
    },
    '''tokenizer_file''': {
        '''facebook/mbart-large-en-ro''': '''https://huggingface.co/facebook/mbart-large-en-ro/resolve/main/tokenizer.json''',
        '''facebook/mbart-large-cc25''': '''https://huggingface.co/facebook/mbart-large-cc25/resolve/main/tokenizer.json''',
    },
}

lowerCamelCase_					=      {
    '''facebook/mbart-large-en-ro''': 1024,
    '''facebook/mbart-large-cc25''': 1024,
}

# fmt: off
lowerCamelCase_					=      ['''ar_AR''', '''cs_CZ''', '''de_DE''', '''en_XX''', '''es_XX''', '''et_EE''', '''fi_FI''', '''fr_XX''', '''gu_IN''', '''hi_IN''', '''it_IT''', '''ja_XX''', '''kk_KZ''', '''ko_KR''', '''lt_LT''', '''lv_LV''', '''my_MM''', '''ne_NP''', '''nl_XX''', '''ro_RO''', '''ru_RU''', '''si_LK''', '''tr_TR''', '''vi_VN''', '''zh_CN''']







class 			UpperCamelCase_       (__A     ):
	__magic_name__	      =				VOCAB_FILES_NAMES
	__magic_name__	      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	__magic_name__	      =				PRETRAINED_VOCAB_FILES_MAP
	__magic_name__	      =				['''input_ids''', '''attention_mask''']
	__magic_name__	      =				MBartTokenizer

	__magic_name__	      =				[]
	__magic_name__	      =				[]





	def __init__(      self					: List[str]	,	lowerCAmelCase_					: List[Any]=None	,	lowerCAmelCase_					: str=None	,	lowerCAmelCase_					: List[Any]="<s>"	,	lowerCAmelCase_					: Optional[Any]="</s>"	,	lowerCAmelCase_					: str="</s>"	,	lowerCAmelCase_					: str="<s>"	,	lowerCAmelCase_					: List[Any]="<unk>"	,	lowerCAmelCase_					: Tuple="<pad>"	,	lowerCAmelCase_					: Union[str, Any]="<mask>"	,	lowerCAmelCase_					: List[Any]=None	,	lowerCAmelCase_					: str=None	,	lowerCAmelCase_					: Optional[Any]=None	,	**lowerCAmelCase_					: Any	,	)						->			Tuple:
				# Mask token behave like a normal word, i.e. include the space before it
				UpperCAmelCase_     : Union[str, Any]			     =					AddedToken(lowerCAmelCase_	,	lstrip=lowerCAmelCase_	,	rstrip=lowerCAmelCase_						) if isinstance(lowerCAmelCase_	,	lowerCAmelCase_						) else mask_token

				super().__init__(
				    vocab_file=lowerCAmelCase_	,	tokenizer_file=lowerCAmelCase_	,	bos_token=lowerCAmelCase_	,	eos_token=lowerCAmelCase_	,	sep_token=lowerCAmelCase_	,	cls_token=lowerCAmelCase_	,	unk_token=lowerCAmelCase_	,	pad_token=lowerCAmelCase_	,	mask_token=lowerCAmelCase_	,	src_lang=lowerCAmelCase_	,	tgt_lang=lowerCAmelCase_	,	additional_special_tokens=lowerCAmelCase_	,	**lowerCAmelCase_	,	)

				UpperCAmelCase_     : Tuple			     =					vocab_file
				UpperCAmelCase_     : str			     =					False if not self.vocab_file else True

				UpperCAmelCase_     : List[Any]			     =					FAIRSEQ_LANGUAGE_CODES.copy()

				if additional_special_tokens is not None:
							# Only add those special tokens if they are not already there.
							_additional_special_tokens.extend(
							    [t for t in additional_special_tokens if t not in _additional_special_tokens]						)

				self.add_special_tokens({"additional_special_tokens": _additional_special_tokens}						)
				UpperCAmelCase_     : Tuple			     =					{
				    lang_code: self.convert_tokens_to_ids(lowerCAmelCase_						) for lang_code in FAIRSEQ_LANGUAGE_CODES
				}

				UpperCAmelCase_     : int			     =					src_lang if src_lang is not None else "en_XX"
				UpperCAmelCase_     : Union[str, Any]			     =					self.convert_tokens_to_ids(self._src_lang						)
				UpperCAmelCase_     : Any			     =					tgt_lang
				self.set_src_lang_special_tokens(self._src_lang						)





	@property
	def      _SCREAMING_SNAKE_CASE      (      self					: Optional[int]						)						->			str:
				return self._src_lang





	@src_lang.setter
	def      _SCREAMING_SNAKE_CASE      (      self					: Any	,	lowerCAmelCase_					: str						)						->			None:
				UpperCAmelCase_     : List[Any]			     =					new_src_lang
				self.set_src_lang_special_tokens(self._src_lang						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Optional[Any]	,	lowerCAmelCase_					: List[int]	,	lowerCAmelCase_					: Optional[List[int]] = None						)						->			List[int]:
				if token_ids_a is None:
							return self.prefix_tokens + token_ids_a + self.suffix_tokens
				# We don't expect to process pairs, but leave the pair logic for API consistency
				return self.prefix_tokens + token_ids_a + token_ids_a + self.suffix_tokens





	def      _SCREAMING_SNAKE_CASE      (      self					: List[Any]	,	lowerCAmelCase_					: List[int]	,	lowerCAmelCase_					: Optional[List[int]] = None						)						->			List[int]:
				UpperCAmelCase_     : List[str]			     =					[self.sep_token_id]
				UpperCAmelCase_     : Dict			     =					[self.cls_token_id]

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





	def      _SCREAMING_SNAKE_CASE      (      self					: Any	,	lowerCAmelCase_					: Tuple	,	lowerCAmelCase_					: str	,	lowerCAmelCase_					: Optional[str]	,	lowerCAmelCase_					: Optional[str]	,	**lowerCAmelCase_					: Union[str, Any]						)						->			Dict:
				if src_lang is None or tgt_lang is None:
							raise ValueError("Translation requires a `src_lang` and a `tgt_lang` for this model"						)
				UpperCAmelCase_     : str			     =					src_lang
				UpperCAmelCase_     : str			     =					self(lowerCAmelCase_	,	add_special_tokens=lowerCAmelCase_	,	return_tensors=lowerCAmelCase_	,	**lowerCAmelCase_						)
				UpperCAmelCase_     : Optional[int]			     =					self.convert_tokens_to_ids(lowerCAmelCase_						)
				UpperCAmelCase_     : Dict			     =					tgt_lang_id
				return inputs





	def      _SCREAMING_SNAKE_CASE      (      self					: List[Any]	,	lowerCAmelCase_					: List[str]	,	lowerCAmelCase_					: str = "en_XX"	,	lowerCAmelCase_					: Optional[List[str]] = None	,	lowerCAmelCase_					: str = "ro_RO"	,	**lowerCAmelCase_					: Dict	,	)						->			BatchEncoding:
				UpperCAmelCase_     : List[Any]			     =					src_lang
				UpperCAmelCase_     : Tuple			     =					tgt_lang
				return super().prepare_seqaseq_batch(lowerCAmelCase_	,	lowerCAmelCase_	,	**lowerCAmelCase_						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Optional[int]						)						->			Any:
				return self.set_src_lang_special_tokens(self.src_lang						)





	def      _SCREAMING_SNAKE_CASE      (      self					: List[Any]						)						->			Dict:
				return self.set_tgt_lang_special_tokens(self.tgt_lang						)





	def      _SCREAMING_SNAKE_CASE      (      self					: Optional[Any]	,	lowerCAmelCase_					: List[Any]						)						->			None:
				UpperCAmelCase_     : int			     =					self.convert_tokens_to_ids(lowerCAmelCase_						)
				UpperCAmelCase_     : str			     =					[]
				UpperCAmelCase_     : str			     =					[self.eos_token_id, self.cur_lang_code]

				UpperCAmelCase_     : Union[str, Any]			     =					self.convert_ids_to_tokens(self.prefix_tokens						)
				UpperCAmelCase_     : List[Any]			     =					self.convert_ids_to_tokens(self.suffix_tokens						)

				UpperCAmelCase_     : Optional[Any]			     =					processors.TemplateProcessing(
				    single=prefix_tokens_str + ["$A"] + suffix_tokens_str	,	pair=prefix_tokens_str + ["$A", "$B"] + suffix_tokens_str	,	special_tokens=list(zip(prefix_tokens_str + suffix_tokens_str	,	self.prefix_tokens + self.suffix_tokens						)						)	,	)





	def      _SCREAMING_SNAKE_CASE      (      self					: Tuple	,	lowerCAmelCase_					: str						)						->			None:
				UpperCAmelCase_     : Union[str, Any]			     =					self.convert_tokens_to_ids(lowerCAmelCase_						)
				UpperCAmelCase_     : Dict			     =					[]
				UpperCAmelCase_     : Optional[int]			     =					[self.eos_token_id, self.cur_lang_code]

				UpperCAmelCase_     : Tuple			     =					self.convert_ids_to_tokens(self.prefix_tokens						)
				UpperCAmelCase_     : Tuple			     =					self.convert_ids_to_tokens(self.suffix_tokens						)

				UpperCAmelCase_     : Optional[Any]			     =					processors.TemplateProcessing(
				    single=prefix_tokens_str + ["$A"] + suffix_tokens_str	,	pair=prefix_tokens_str + ["$A", "$B"] + suffix_tokens_str	,	special_tokens=list(zip(prefix_tokens_str + suffix_tokens_str	,	self.prefix_tokens + self.suffix_tokens						)						)	,	)





	def      _SCREAMING_SNAKE_CASE      (      self					: str	,	lowerCAmelCase_					: str	,	lowerCAmelCase_					: Optional[str] = None						)						->			Tuple[str]:
				if not self.can_save_slow_tokenizer:
							raise ValueError(
							    "Your fast tokenizer does not have the necessary information to save the vocabulary for a slow "
							    "tokenizer."						)

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

				if os.path.abspath(self.vocab_file						) != os.path.abspath(lowerCAmelCase_						):
							copyfile(self.vocab_file	,	lowerCAmelCase_						)

				return (out_vocab_file,)



