





from collections import OrderedDict
from typing import Any, List, Mapping, Optional

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import logging


__lowercase       :str  =  logging.get_logger(__name__)

__lowercase       :List[Any]  =  {
    "EleutherAI/gpt-j-6B": "https://huggingface.co/EleutherAI/gpt-j-6B/resolve/main/config.json",
    # See all GPT-J models at https://huggingface.co/models?filter=gpt_j
}



class    _a     (				_lowercase							):






							"""simple docstring"""

							snake_case_							 =						'''gptj'''
							snake_case_							 =						{
							    '''max_position_embeddings''': '''n_positions''',
							    '''hidden_size''': '''n_embd''',
							    '''num_attention_heads''': '''n_head''',
							    '''num_hidden_layers''': '''n_layer''',
							}

							def __init__(      self				:     str							,	a				:     Tuple=5_04_00							,	a				:     Union[str, Any]=20_48							,	a				:     Tuple=40_96							,	a				:     Any=28							,	a				:     List[str]=16							,	a				:     Tuple=64							,	a				:     List[str]=None							,	a				:     Optional[int]="gelu_new"							,	a				:     Tuple=0.0							,	a				:     Union[str, Any]=0.0							,	a				:     Tuple=0.0							,	a				:     Optional[int]=1E-5							,	a				:     str=0.02							,	a				:     Optional[Any]=True							,	a				:     Optional[Any]=5_02_56							,	a				:     List[Any]=5_02_56							,	a				:     Any=False							,	**a				:     int							,	)	->int:
													SCREAMING_SNAKE_CASE__     :				Any   =					vocab_size
													SCREAMING_SNAKE_CASE__     :				str   =					n_positions
													SCREAMING_SNAKE_CASE__     :				Optional[int]   =					n_embd
													SCREAMING_SNAKE_CASE__     :				List[Any]   =					n_layer
													SCREAMING_SNAKE_CASE__     :				int   =					n_head
													SCREAMING_SNAKE_CASE__     :				Dict   =					n_inner
													SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					rotary_dim
													SCREAMING_SNAKE_CASE__     :				Dict   =					activation_function
													SCREAMING_SNAKE_CASE__     :				str   =					resid_pdrop
													SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					embd_pdrop
													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					attn_pdrop
													SCREAMING_SNAKE_CASE__     :				Optional[int]   =					layer_norm_epsilon
													SCREAMING_SNAKE_CASE__     :				Any   =					initializer_range
													SCREAMING_SNAKE_CASE__     :				str   =					use_cache

													SCREAMING_SNAKE_CASE__     :				Tuple   =					bos_token_id
													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					eos_token_id

													super().__init__(
													    bos_token_id=A_							,	eos_token_id=A_							,	tie_word_embeddings=A_							,	**A_    )







class    _a     (				_lowercase							):






							"""simple docstring"""

							def __init__(      self				:     Union[str, Any]							,	a				:     PretrainedConfig							,	a				:     str = "default"							,	a				:     List[PatchingSpec] = None							,	a				:     bool = False							,	)	->Union[str, Any]:
													super().__init__(A_							,	task=A_							,	patching_specs=A_							,	use_past=A_    )
													if not getattr(self._config							,	"pad_token_id"							,	A_    ):
																			# TODO: how to do that better?
																			SCREAMING_SNAKE_CASE__     :				List[str]   =					0

							@property
							def      A_  (      self				:     Tuple    )	->Mapping[str, Mapping[int, str]]:
													SCREAMING_SNAKE_CASE__     :				Optional[int]   =					OrderedDict({"input_ids": {0: "batch", 1: "sequence"}}    )
													if self.use_past:
																			self.fill_with_past_key_values_(A_							,	direction="inputs"    )
																			SCREAMING_SNAKE_CASE__     :				Tuple   =					{0: "batch", 1: "past_sequence + sequence"}
													else:
																			SCREAMING_SNAKE_CASE__     :				List[str]   =					{0: "batch", 1: "sequence"}

													return common_inputs

							@property
							def      A_  (      self				:     str    )	->int:
													return self._config.n_layer

							@property
							def      A_  (      self				:     int    )	->int:
													return self._config.n_head

							def      A_  (      self				:     Optional[Any]							,	a				:     PreTrainedTokenizer							,	a				:     int = -1							,	a				:     int = -1							,	a				:     bool = False							,	a				:     Optional[TensorType] = None							,	)	->Mapping[str, Any]:
													SCREAMING_SNAKE_CASE__     :				int   =					super(A_							,	self    ).generate_dummy_inputs(
													    A_							,	batch_size=A_							,	seq_length=A_							,	is_pair=A_							,	framework=A_    )

													# We need to order the input in the way they appears in the forward()
													SCREAMING_SNAKE_CASE__     :				Optional[int]   =					OrderedDict({"input_ids": common_inputs["input_ids"]}    )

													# Need to add the past_keys
													if self.use_past:
																			if not is_torch_available():
																									raise ValueError("Cannot generate dummy past_keys inputs without PyTorch installed."    )
																			else:
																									import torch

																									SCREAMING_SNAKE_CASE__,							SCREAMING_SNAKE_CASE__     :				Dict   =					common_inputs["input_ids"].shape
																									# Not using the same length for past_key_values
																									SCREAMING_SNAKE_CASE__     :				str   =					seqlen + 2
																									SCREAMING_SNAKE_CASE__     :				int   =					(
																									    batch,
																									    self.num_attention_heads,
																									    past_key_values_length,
																									    self._config.hidden_size // self.num_attention_heads,
																									)
																									SCREAMING_SNAKE_CASE__     :				str   =					[
																									    (torch.zeros(A_    ), torch.zeros(A_    )) for _ in range(self.num_layers    )
																									]

													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					common_inputs["attention_mask"]
													if self.use_past:
																			SCREAMING_SNAKE_CASE__     :				List[str]   =					ordered_inputs["attention_mask"].dtype
																			SCREAMING_SNAKE_CASE__     :				Optional[int]   =					torch.cat(
																			    [ordered_inputs["attention_mask"], torch.ones(A_							,	A_							,	dtype=A_    )]							,	dim=1    )

													return ordered_inputs






							@property
							def      A_  (      self				:     Union[str, Any]    )	->int:
													return 13






import json
import os
import sys
import tempfile
import unittest
from pathlib import Path
from shutil import copyfile

from huggingface_hub import HfFolder, Repository, create_repo, delete_repo
from requests.exceptions import HTTPError

import transformers
from transformers import (
    CONFIG_MAPPING,
    FEATURE_EXTRACTOR_MAPPING,
    PROCESSOR_MAPPING,
    TOKENIZER_MAPPING,
    AutoConfig,
    AutoFeatureExtractor,
    AutoProcessor,
    AutoTokenizer,
    BertTokenizer,
    ProcessorMixin,
    WavaVecaConfig,
    WavaVecaFeatureExtractor,
    WavaVecaProcessor,
)
from transformers.testing_utils import TOKEN, USER, get_tests_dir, is_staging_test
from transformers.tokenization_utils import TOKENIZER_CONFIG_FILE
from transformers.utils import FEATURE_EXTRACTOR_NAME, is_tokenizers_available


sys.path.append(str(Path(__file__).parent.parent.parent.parent / "utils"))

from test_module.custom_configuration import CustomConfig  # noqa E402
from test_module.custom_feature_extraction import CustomFeatureExtractor  # noqa E402
from test_module.custom_processing import CustomProcessor  # noqa E402
from test_module.custom_tokenization import CustomTokenizer  # noqa E402


__lowercase       :List[str]       =  get_tests_dir("fixtures/dummy_feature_extractor_config.json")
__lowercase       :str       =  get_tests_dir("fixtures/vocab.json")
__lowercase       :Optional[int]       =  get_tests_dir("fixtures")



class    _a     (				unittest.TestCase							):






							"""simple docstring"""

							snake_case_							 =						["[UNK]", "[CLS]", "[SEP]", "[PAD]", "[MASK]", "bla", "blou"]

							def      A_  (      self				:     Optional[Any]    )	->int:
													SCREAMING_SNAKE_CASE__     :				Dict   =					0

							def      A_  (      self				:     Any    )	->Optional[int]:
													SCREAMING_SNAKE_CASE__     :				List[Any]   =					AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h"    )
													self.assertIsInstance(a							,	a    )

							def      A_  (      self				:     Union[str, Any]    )	->List[str]:
													with tempfile.TemporaryDirectory() as tmpdirname:
																			SCREAMING_SNAKE_CASE__     :				Dict   =					WavaVecaConfig()
																			SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h"    )

																			# save in new folder
																			model_config.save_pretrained(a    )
																			processor.save_pretrained(a    )

																			SCREAMING_SNAKE_CASE__     :				str   =					AutoProcessor.from_pretrained(a    )

													self.assertIsInstance(a							,	a    )

							def      A_  (      self				:     int    )	->List[str]:
													with tempfile.TemporaryDirectory() as tmpdirname:
																			# copy relevant files
																			copyfile(a							,	os.path.join(a							,	a    )    )
																			copyfile(a							,	os.path.join(a							,	"vocab.json"    )    )

																			SCREAMING_SNAKE_CASE__     :				List[Any]   =					AutoProcessor.from_pretrained(a    )

													self.assertIsInstance(a							,	a    )

							def      A_  (      self				:     List[Any]    )	->Tuple:
													with tempfile.TemporaryDirectory() as tmpdirname:
																			SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					WavaVecaFeatureExtractor()
																			SCREAMING_SNAKE_CASE__     :				Tuple   =					AutoTokenizer.from_pretrained("facebook/wav2vec2-base-960h"    )

																			SCREAMING_SNAKE_CASE__     :				Any   =					WavaVecaProcessor(a							,	a    )

																			# save in new folder
																			processor.save_pretrained(a    )

																			# drop `processor_class` in tokenizer
																			with open(os.path.join(a							,	a    )							,	"r"    ) as f:
																									SCREAMING_SNAKE_CASE__     :				Optional[int]   =					json.load(a    )
																									config_dict.pop("processor_class"    )

																			with open(os.path.join(a							,	a    )							,	"w"    ) as f:
																									f.write(json.dumps(a    )    )

																			SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					AutoProcessor.from_pretrained(a    )

													self.assertIsInstance(a							,	a    )

							def      A_  (      self				:     List[str]    )	->Optional[Any]:
													with tempfile.TemporaryDirectory() as tmpdirname:
																			SCREAMING_SNAKE_CASE__     :				Tuple   =					WavaVecaFeatureExtractor()
																			SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					AutoTokenizer.from_pretrained("facebook/wav2vec2-base-960h"    )

																			SCREAMING_SNAKE_CASE__     :				Optional[int]   =					WavaVecaProcessor(a							,	a    )

																			# save in new folder
																			processor.save_pretrained(a    )

																			# drop `processor_class` in feature extractor
																			with open(os.path.join(a							,	a    )							,	"r"    ) as f:
																									SCREAMING_SNAKE_CASE__     :				List[Any]   =					json.load(a    )
																									config_dict.pop("processor_class"    )

																			with open(os.path.join(a							,	a    )							,	"w"    ) as f:
																									f.write(json.dumps(a    )    )

																			SCREAMING_SNAKE_CASE__     :				List[Any]   =					AutoProcessor.from_pretrained(a    )

													self.assertIsInstance(a							,	a    )

							def      A_  (      self				:     Union[str, Any]    )	->str:
													with tempfile.TemporaryDirectory() as tmpdirname:
																			SCREAMING_SNAKE_CASE__     :				List[Any]   =					WavaVecaConfig(processor_class="Wav2Vec2Processor"    )
																			model_config.save_pretrained(a    )
																			# copy relevant files
																			copyfile(a							,	os.path.join(a							,	"vocab.json"    )    )
																			# create emtpy sample processor
																			with open(os.path.join(a							,	a    )							,	"w"    ) as f:
																									f.write("{}"    )

																			SCREAMING_SNAKE_CASE__     :				Tuple   =					AutoProcessor.from_pretrained(a    )

													self.assertIsInstance(a							,	a    )

							def      A_  (      self				:     Optional[Any]    )	->Optional[int]:
													# If remote code is not set, we will time out when asking whether to load the model.
													with self.assertRaises(a    ):
																			SCREAMING_SNAKE_CASE__     :				Optional[int]   =					AutoProcessor.from_pretrained("hf-internal-testing/test_dynamic_processor"    )
													# If remote code is disabled, we can't load this config.
													with self.assertRaises(a    ):
																			SCREAMING_SNAKE_CASE__     :				Any   =					AutoProcessor.from_pretrained(
																			    "hf-internal-testing/test_dynamic_processor"							,	trust_remote_code=a    )

													SCREAMING_SNAKE_CASE__     :				List[Any]   =					AutoProcessor.from_pretrained("hf-internal-testing/test_dynamic_processor"							,	trust_remote_code=a    )
													self.assertTrue(processor.special_attribute_present    )
													self.assertEqual(processor.__class__.__name__							,	"NewProcessor"    )

													SCREAMING_SNAKE_CASE__     :				Dict   =					processor.feature_extractor
													self.assertTrue(feature_extractor.special_attribute_present    )
													self.assertEqual(feature_extractor.__class__.__name__							,	"NewFeatureExtractor"    )

													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					processor.tokenizer
													self.assertTrue(tokenizer.special_attribute_present    )
													if is_tokenizers_available():
																			self.assertEqual(tokenizer.__class__.__name__							,	"NewTokenizerFast"    )

																			# Test we can also load the slow version
																			SCREAMING_SNAKE_CASE__     :				int   =					AutoProcessor.from_pretrained(
																			    "hf-internal-testing/test_dynamic_processor"							,	trust_remote_code=a							,	use_fast=a    )
																			SCREAMING_SNAKE_CASE__     :				List[Any]   =					new_processor.tokenizer
																			self.assertTrue(new_tokenizer.special_attribute_present    )
																			self.assertEqual(new_tokenizer.__class__.__name__							,	"NewTokenizer"    )
													else:
																			self.assertEqual(tokenizer.__class__.__name__							,	"NewTokenizer"    )

							def      A_  (      self				:     Tuple    )	->List[Any]:
													try:
																			AutoConfig.register("custom"							,	a    )
																			AutoFeatureExtractor.register(a							,	a    )
																			AutoTokenizer.register(a							,	slow_tokenizer_class=a    )
																			AutoProcessor.register(a							,	a    )
																			# Trying to register something existing in the Transformers library will raise an error
																			with self.assertRaises(a    ):
																									AutoProcessor.register(a							,	a    )

																			# Now that the config is registered, it can be used as any other config with the auto-API
																			SCREAMING_SNAKE_CASE__     :				List[str]   =					CustomFeatureExtractor.from_pretrained(a    )

																			with tempfile.TemporaryDirectory() as tmp_dir:
																									SCREAMING_SNAKE_CASE__     :				int   =					os.path.join(a							,	"vocab.txt"    )
																									with open(a							,	"w"							,	encoding="utf-8"    ) as vocab_writer:
																															vocab_writer.write("".join([x + "\n" for x in self.vocab_tokens]    )    )
																									SCREAMING_SNAKE_CASE__     :				Optional[int]   =					CustomTokenizer(a    )

																			SCREAMING_SNAKE_CASE__     :				List[Any]   =					CustomProcessor(a							,	a    )

																			with tempfile.TemporaryDirectory() as tmp_dir:
																									processor.save_pretrained(a    )
																									SCREAMING_SNAKE_CASE__     :				Any   =					AutoProcessor.from_pretrained(a    )
																									self.assertIsInstance(a							,	a    )

													finally:
																			if "custom" in CONFIG_MAPPING._extra_content:
																									del CONFIG_MAPPING._extra_content["custom"]
																			if CustomConfig in FEATURE_EXTRACTOR_MAPPING._extra_content:
																									del FEATURE_EXTRACTOR_MAPPING._extra_content[CustomConfig]
																			if CustomConfig in TOKENIZER_MAPPING._extra_content:
																									del TOKENIZER_MAPPING._extra_content[CustomConfig]
																			if CustomConfig in PROCESSOR_MAPPING._extra_content:
																									del PROCESSOR_MAPPING._extra_content[CustomConfig]

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



													class    _a     (				lowercase__							):






																				"""simple docstring"""

																				snake_case_							 =						False







													class    _a     (				lowercase__							):






																				"""simple docstring"""

																				snake_case_							 =						False







													class    _a     (				lowercase__							):






																				"""simple docstring"""

																				snake_case_							 =						"AutoFeatureExtractor"
																				snake_case_							 =						"AutoTokenizer"
																				snake_case_							 =						False

													try:
																			AutoConfig.register("custom"							,	a    )
																			AutoFeatureExtractor.register(a							,	a    )
																			AutoTokenizer.register(a							,	slow_tokenizer_class=a    )
																			AutoProcessor.register(a							,	a    )
																			# If remote code is not set, the default is to use local classes.
																			SCREAMING_SNAKE_CASE__     :				Optional[int]   =					AutoProcessor.from_pretrained("hf-internal-testing/test_dynamic_processor"    )
																			self.assertEqual(processor.__class__.__name__							,	"NewProcessor"    )
																			self.assertFalse(processor.special_attribute_present    )
																			self.assertFalse(processor.feature_extractor.special_attribute_present    )
																			self.assertFalse(processor.tokenizer.special_attribute_present    )

																			# If remote code is disabled, we load the local ones.
																			SCREAMING_SNAKE_CASE__     :				Tuple   =					AutoProcessor.from_pretrained(
																			    "hf-internal-testing/test_dynamic_processor"							,	trust_remote_code=a    )
																			self.assertEqual(processor.__class__.__name__							,	"NewProcessor"    )
																			self.assertFalse(processor.special_attribute_present    )
																			self.assertFalse(processor.feature_extractor.special_attribute_present    )
																			self.assertFalse(processor.tokenizer.special_attribute_present    )

																			# If remote is enabled, we load from the Hub.
																			SCREAMING_SNAKE_CASE__     :				Any   =					AutoProcessor.from_pretrained(
																			    "hf-internal-testing/test_dynamic_processor"							,	trust_remote_code=a    )
																			self.assertEqual(processor.__class__.__name__							,	"NewProcessor"    )
																			self.assertTrue(processor.special_attribute_present    )
																			self.assertTrue(processor.feature_extractor.special_attribute_present    )
																			self.assertTrue(processor.tokenizer.special_attribute_present    )

													finally:
																			if "custom" in CONFIG_MAPPING._extra_content:
																									del CONFIG_MAPPING._extra_content["custom"]
																			if CustomConfig in FEATURE_EXTRACTOR_MAPPING._extra_content:
																									del FEATURE_EXTRACTOR_MAPPING._extra_content[CustomConfig]
																			if CustomConfig in TOKENIZER_MAPPING._extra_content:
																									del TOKENIZER_MAPPING._extra_content[CustomConfig]
																			if CustomConfig in PROCESSOR_MAPPING._extra_content:
																									del PROCESSOR_MAPPING._extra_content[CustomConfig]

							def      A_  (      self				:     Optional[Any]    )	->Dict:
													SCREAMING_SNAKE_CASE__     :				Optional[int]   =					AutoProcessor.from_pretrained("hf-internal-testing/tiny-random-bert"    )
													self.assertEqual(processor.__class__.__name__							,	"BertTokenizerFast"    )






							def      A_  (      self				:     Dict    )	->Union[str, Any]:
													SCREAMING_SNAKE_CASE__     :				Dict   =					AutoProcessor.from_pretrained("hf-internal-testing/tiny-random-convnext"    )
													self.assertEqual(processor.__class__.__name__							,	"ConvNextImageProcessor"    )







@is_staging_test
class    _a     (				unittest.TestCase							):






							"""simple docstring"""

							snake_case_							 =						["[UNK]", "[CLS]", "[SEP]", "[PAD]", "[MASK]", "bla", "blou"]

							@classmethod
							def      A_  (      cls				:     List[str]    )	->Union[str, Any]:
													SCREAMING_SNAKE_CASE__     :				int   =					TOKEN
													HfFolder.save_token(a    )

							@classmethod
							def      A_  (      cls				:     List[str]    )	->Optional[int]:
													try:
																			delete_repo(token=cls._token							,	repo_id="test-processor"    )
													except HTTPError:
																			pass

													try:
																			delete_repo(token=cls._token							,	repo_id="valid_org/test-processor-org"    )
													except HTTPError:
																			pass

													try:
																			delete_repo(token=cls._token							,	repo_id="test-dynamic-processor"    )
													except HTTPError:
																			pass

							def      A_  (      self				:     Dict    )	->Dict:
													SCREAMING_SNAKE_CASE__     :				Tuple   =					WavaVecaProcessor.from_pretrained(a    )
													with tempfile.TemporaryDirectory() as tmp_dir:
																			processor.save_pretrained(
																			    os.path.join(a							,	"test-processor"    )							,	push_to_hub=a							,	use_auth_token=self._token    )

																			SCREAMING_SNAKE_CASE__     :				Optional[int]   =					WavaVecaProcessor.from_pretrained(f"""{USER}/test-processor"""    )
																			for k, v in processor.feature_extractor.__dict__.items():
																									self.assertEqual(a							,	getattr(new_processor.feature_extractor							,	a    )    )
																			self.assertDictEqual(new_processor.tokenizer.get_vocab()							,	processor.tokenizer.get_vocab()    )

							def      A_  (      self				:     List[str]    )	->Union[str, Any]:
													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					WavaVecaProcessor.from_pretrained(a    )

													with tempfile.TemporaryDirectory() as tmp_dir:
																			processor.save_pretrained(
																			    os.path.join(a							,	"test-processor-org"    )							,	push_to_hub=a							,	use_auth_token=self._token							,	organization="valid_org"							,	)

																			SCREAMING_SNAKE_CASE__     :				Dict   =					WavaVecaProcessor.from_pretrained("valid_org/test-processor-org"    )
																			for k, v in processor.feature_extractor.__dict__.items():
																									self.assertEqual(a							,	getattr(new_processor.feature_extractor							,	a    )    )
																			self.assertDictEqual(new_processor.tokenizer.get_vocab()							,	processor.tokenizer.get_vocab()    )






							def      A_  (      self				:     Any    )	->int:
													CustomFeatureExtractor.register_for_auto_class()
													CustomTokenizer.register_for_auto_class()
													CustomProcessor.register_for_auto_class()

													SCREAMING_SNAKE_CASE__     :				Any   =					CustomFeatureExtractor.from_pretrained(a    )

													with tempfile.TemporaryDirectory() as tmp_dir:
																			SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					os.path.join(a							,	"vocab.txt"    )
																			with open(a							,	"w"							,	encoding="utf-8"    ) as vocab_writer:
																									vocab_writer.write("".join([x + "\n" for x in self.vocab_tokens]    )    )
																			SCREAMING_SNAKE_CASE__     :				str   =					CustomTokenizer(a    )

													SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					CustomProcessor(a							,	a    )

													with tempfile.TemporaryDirectory() as tmp_dir:
																			create_repo(f"""{USER}/test-dynamic-processor"""							,	token=self._token    )
																			SCREAMING_SNAKE_CASE__     :				str   =					Repository(a							,	clone_from=f"""{USER}/test-dynamic-processor"""							,	token=self._token    )
																			processor.save_pretrained(a    )

																			# This has added the proper auto_map field to the feature extractor config
																			self.assertDictEqual(
																			    processor.feature_extractor.auto_map							,	{
																			        "AutoFeatureExtractor": "custom_feature_extraction.CustomFeatureExtractor",
																			        "AutoProcessor": "custom_processing.CustomProcessor",
																			    }							,	)

																			# This has added the proper auto_map field to the tokenizer config
																			with open(os.path.join(a							,	"tokenizer_config.json"    )    ) as f:
																									SCREAMING_SNAKE_CASE__     :				str   =					json.load(a    )
																			self.assertDictEqual(
																			    tokenizer_config["auto_map"]							,	{
																			        "AutoTokenizer": ["custom_tokenization.CustomTokenizer", None],
																			        "AutoProcessor": "custom_processing.CustomProcessor",
																			    }							,	)

																			# The code has been copied from fixtures
																			self.assertTrue(os.path.isfile(os.path.join(a							,	"custom_feature_extraction.py"    )    )    )
																			self.assertTrue(os.path.isfile(os.path.join(a							,	"custom_tokenization.py"    )    )    )
																			self.assertTrue(os.path.isfile(os.path.join(a							,	"custom_processing.py"    )    )    )

																			repo.push_to_hub()

													SCREAMING_SNAKE_CASE__     :				List[Any]   =					AutoProcessor.from_pretrained(f"""{USER}/test-dynamic-processor"""							,	trust_remote_code=a    )
													# Can't make an isinstance check because the new_processor is from the CustomProcessor class of a dynamic module
													self.assertEqual(new_processor.__class__.__name__							,	"CustomProcessor"    )