import argparse
import os
from pathlib import Path

import torch
from bark.generation import _load_model as _bark_load_model
from huggingface_hub import hf_hub_download

from transformers import EncodecConfig, EncodecModel, set_seed
from transformers.models.bark.configuration_bark import (
    BarkCoarseConfig,
    BarkConfig,
    BarkFineConfig,
    BarkSemanticConfig,
)
from transformers.models.bark.generation_configuration_bark import (
    BarkCoarseGenerationConfig,
    BarkFineGenerationConfig,
    BarkGenerationConfig,
    BarkSemanticGenerationConfig,
)
from transformers.models.bark.modeling_bark import BarkCoarseModel, BarkFineModel, BarkModel, BarkSemanticModel
from transformers.utils import logging


logging.set_verbosity_info()
__lowercase							 =					logging.get_logger(__name__)

set_seed(770)


__lowercase							 =					{
    '''c_attn''': '''att_proj''',
    '''c_proj''': '''out_proj''',
    '''c_fc''': '''in_proj''',
    '''transformer.''': '''''',
    '''h.''': '''layers.''',
    '''ln_1''': '''layernorm_1''',
    '''ln_2''': '''layernorm_2''',
    '''ln_f''': '''layernorm_final''',
    '''wpe''': '''position_embeds_layer''',
    '''wte''': '''input_embeds_layer''',
}


__lowercase							 =					{
    '''text_small''': {
        '''repo_id''': '''suno/bark''',
        '''file_name''': '''text.pt''',
    },
    '''coarse_small''': {
        '''repo_id''': '''suno/bark''',
        '''file_name''': '''coarse.pt''',
    },
    '''fine_small''': {
        '''repo_id''': '''suno/bark''',
        '''file_name''': '''fine.pt''',
    },
    '''text''': {
        '''repo_id''': '''suno/bark''',
        '''file_name''': '''text_2.pt''',
    },
    '''coarse''': {
        '''repo_id''': '''suno/bark''',
        '''file_name''': '''coarse_2.pt''',
    },
    '''fine''': {
        '''repo_id''': '''suno/bark''',
        '''file_name''': '''fine_2.pt''',
    },
}

__lowercase							 =					os.path.dirname(os.path.abspath(__file__))
__lowercase							 =					os.path.join(os.path.expanduser('''~'''), '''.cache''')
__lowercase							 =					os.path.join(os.getenv('''XDG_CACHE_HOME''', default_cache_dir), '''suno''', '''bark_v0''')



def lowerCamelCase  (   SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE=False	):
    '''simple docstring'''







    __UpperCamelCase     :str			  =		model_type
    if use_small:
        key += "_small"
    return os.path.join(SCREAMING_SNAKE_CASE  ,			REMOTE_MODEL_PATHS[key]['''file_name''']	)



def lowerCamelCase  (   SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	):
    '''simple docstring'''







    os.makedirs(SCREAMING_SNAKE_CASE  ,			exist_ok=SCREAMING_SNAKE_CASE	)
    hf_hub_download(repo_id=SCREAMING_SNAKE_CASE  ,			filename=SCREAMING_SNAKE_CASE  ,			local_dir=SCREAMING_SNAKE_CASE	)



def lowerCamelCase  (   SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE=False  ,			SCREAMING_SNAKE_CASE="text"	):
    '''simple docstring'''







    if model_type == "text":
        __UpperCamelCase     :Tuple			  =		BarkSemanticModel
        __UpperCamelCase     :List[str]			  =		BarkSemanticConfig
        __UpperCamelCase     :Any			  =		BarkSemanticGenerationConfig
    elif model_type == "coarse":
        __UpperCamelCase     :int			  =		BarkCoarseModel
        __UpperCamelCase     :Optional[Any]			  =		BarkCoarseConfig
        __UpperCamelCase     :Tuple			  =		BarkCoarseGenerationConfig
    elif model_type == "fine":
        __UpperCamelCase     :Any			  =		BarkFineModel
        __UpperCamelCase     :Union[str, Any]			  =		BarkFineConfig
        __UpperCamelCase     :Any			  =		BarkFineGenerationConfig
    else:
        raise NotImplementedError()
    __UpperCamelCase     :Union[str, Any]			  =		f"""{model_type}_small""" if use_small else model_type
    __UpperCamelCase     :Tuple			  =		REMOTE_MODEL_PATHS[model_key]
    if not os.path.exists(SCREAMING_SNAKE_CASE	):
        logger.info(f"""{model_type} model not found, downloading into `{CACHE_DIR}`."""	)
        _download(model_info['''repo_id''']  ,			model_info['''file_name''']	)
    __UpperCamelCase     :List[str]			  =		torch.load(SCREAMING_SNAKE_CASE  ,			map_location=SCREAMING_SNAKE_CASE	)
    # this is a hack
    __UpperCamelCase     :str			  =		checkpoint['''model_args''']
    if "input_vocab_size" not in model_args:
        __UpperCamelCase     :Dict			  =		model_args['''vocab_size''']
        __UpperCamelCase     :Dict			  =		model_args['''vocab_size''']
        del model_args["vocab_size"]

    # convert Bark model arguments to HF Bark model arguments
    __UpperCamelCase     :Tuple			  =		model_args.pop('''n_head'''	)
    __UpperCamelCase     :Optional[Any]			  =		model_args.pop('''n_embd'''	)
    __UpperCamelCase     :List[Any]			  =		model_args.pop('''n_layer'''	)

    __UpperCamelCase     :Union[str, Any]			  =		ConfigClass(**checkpoint['''model_args''']	)
    __UpperCamelCase     :str			  =		ModelClass(config=SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :str			  =		GenerationConfigClass()

    __UpperCamelCase     :Tuple			  =		model_generation_config
    __UpperCamelCase     :str			  =		checkpoint['''model''']
    # fixup checkpoint
    __UpperCamelCase     :List[Any]			  =		'''_orig_mod.'''
    for k, v in list(state_dict.items()	):
        if k.startswith(SCREAMING_SNAKE_CASE	):
            # replace part of the key with corresponding layer name in HF implementation
            __UpperCamelCase     :Optional[Any]			  =		k[len(SCREAMING_SNAKE_CASE	) :]
            for old_layer_name in new_layer_name_dict:
                __UpperCamelCase     :Union[str, Any]			  =		new_k.replace(SCREAMING_SNAKE_CASE  ,			new_layer_name_dict[old_layer_name]	)

            __UpperCamelCase     :List[str]			  =		state_dict.pop(SCREAMING_SNAKE_CASE	)

    __UpperCamelCase     :Tuple			  =		set(state_dict.keys()	) - set(model.state_dict().keys()	)
    __UpperCamelCase     :int			  =		{k for k in extra_keys if not k.endswith('''.attn.bias'''	)}
    __UpperCamelCase     :int			  =		set(model.state_dict().keys()	) - set(state_dict.keys()	)
    __UpperCamelCase     :int			  =		{k for k in missing_keys if not k.endswith('''.attn.bias'''	)}
    if len(SCREAMING_SNAKE_CASE	) != 0:
        raise ValueError(f"""extra keys found: {extra_keys}"""	)
    if len(SCREAMING_SNAKE_CASE	) != 0:
        raise ValueError(f"""missing keys: {missing_keys}"""	)
    model.load_state_dict(SCREAMING_SNAKE_CASE  ,			strict=SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :List[Any]			  =		model.num_parameters(exclude_embeddings=SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :Tuple			  =		checkpoint['''best_val_loss'''].item()
    logger.info(f"""model loaded: {round(n_params/1e6  ,			1	)}M params, {round(SCREAMING_SNAKE_CASE  ,			3	)} loss"""	)
    model.eval()
    model.to(SCREAMING_SNAKE_CASE	)
    del checkpoint, state_dict

    return model



def lowerCamelCase  (   SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE=False  ,			SCREAMING_SNAKE_CASE="text"	):
    '''simple docstring'''







    if model_type not in ("text", "coarse", "fine"):
        raise NotImplementedError()

    __UpperCamelCase     :List[Any]			  =		'''cpu'''  # do conversion on cpu

    __UpperCamelCase     :List[Any]			  =		_get_ckpt_path(SCREAMING_SNAKE_CASE  ,			use_small=SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :int			  =		_load_model(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			model_type=SCREAMING_SNAKE_CASE  ,			use_small=SCREAMING_SNAKE_CASE	)

    # load bark initial model
    __UpperCamelCase     :Optional[Any]			  =		_bark_load_model(SCREAMING_SNAKE_CASE  ,			'''cpu'''  ,			model_type=SCREAMING_SNAKE_CASE  ,			use_small=SCREAMING_SNAKE_CASE	)

    if model_type == "text":
        __UpperCamelCase     :Dict			  =		bark_model['''model''']

    if model.num_parameters(exclude_embeddings=SCREAMING_SNAKE_CASE	) != bark_model.get_num_params():
        raise ValueError('''initial and new models don\'t have the same number of parameters'''	)

    # check if same output as the bark model
    __UpperCamelCase     :List[str]			  =		5
    __UpperCamelCase     :List[str]			  =		10

    if model_type in ["text", "coarse"]:
        __UpperCamelCase     :Dict			  =		torch.randint(256  ,			(batch_size, sequence_length)  ,			dtype=torch.int	)
        __UpperCamelCase     :str			  =		bark_model(SCREAMING_SNAKE_CASE	)[0]

        __UpperCamelCase     :Optional[int]			  =		model(SCREAMING_SNAKE_CASE	)

        # take last logits
        __UpperCamelCase     :str			  =		output_new_model_total.logits[:, [-1], :]

    else:
        __UpperCamelCase     :Any			  =		3
        __UpperCamelCase     :List[Any]			  =		8
        __UpperCamelCase     :Tuple			  =		torch.randint(256  ,			(batch_size, sequence_length, n_codes_total)  ,			dtype=torch.int	)

        __UpperCamelCase     :Tuple			  =		model(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)
        __UpperCamelCase     :str			  =		bark_model(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)

        __UpperCamelCase     :str			  =		output_new_model_total.logits

    # output difference should come from the difference of self-attention implementation design
    if output_new_model.shape != output_old_model.shape:
        raise ValueError('''initial and new outputs don\'t have the same shape'''	)
    if (output_new_model - output_old_model).abs().max().item() > 1e-3:
        raise ValueError('''initial and new outputs are not equal'''	)

    Path(SCREAMING_SNAKE_CASE	).mkdir(exist_ok=SCREAMING_SNAKE_CASE	)
    model.save_pretrained(SCREAMING_SNAKE_CASE	)



def lowerCamelCase  (   SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			):
    '''simple docstring'''







    __UpperCamelCase     :List[str]			  =		os.path.join(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)

    __UpperCamelCase     :str			  =		BarkSemanticConfig.from_pretrained(os.path.join(SCREAMING_SNAKE_CASE  ,			'''config.json'''	)	)
    __UpperCamelCase     :Optional[int]			  =		BarkCoarseConfig.from_pretrained(os.path.join(SCREAMING_SNAKE_CASE  ,			'''config.json'''	)	)
    __UpperCamelCase     :Tuple			  =		BarkFineConfig.from_pretrained(os.path.join(SCREAMING_SNAKE_CASE  ,			'''config.json'''	)	)
    __UpperCamelCase     :List[Any]			  =		EncodecConfig.from_pretrained('''facebook/encodec_24khz'''	)

    __UpperCamelCase     :Union[str, Any]			  =		BarkSemanticModel.from_pretrained(SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :Dict			  =		BarkCoarseModel.from_pretrained(SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :List[Any]			  =		BarkFineModel.from_pretrained(SCREAMING_SNAKE_CASE	)
    __UpperCamelCase     :str			  =		EncodecModel.from_pretrained('''facebook/encodec_24khz'''	)

    __UpperCamelCase     :Tuple			  =		BarkConfig.from_sub_model_configs(
        SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)

    __UpperCamelCase     :Union[str, Any]			  =		BarkGenerationConfig.from_sub_model_configs(
        semantic.generation_config  ,			coarseAcoustic.generation_config  ,			fineAcoustic.generation_config	)

    __UpperCamelCase     :int			  =		BarkModel(SCREAMING_SNAKE_CASE	)

    __UpperCamelCase     :List[str]			  =		semantic
    __UpperCamelCase     :Any			  =		coarseAcoustic
    __UpperCamelCase     :Tuple			  =		fineAcoustic
    __UpperCamelCase     :List[Any]			  =		codec

    __UpperCamelCase     :int			  =		bark_generation_config

    Path(SCREAMING_SNAKE_CASE	).mkdir(exist_ok=SCREAMING_SNAKE_CASE	)
    bark.save_pretrained(SCREAMING_SNAKE_CASE  ,			repo_id=SCREAMING_SNAKE_CASE  ,			push_to_hub=SCREAMING_SNAKE_CASE	)


if __name__ == "__main__":
    __lowercase							 =					argparse.ArgumentParser()
    # Required parameters

    parser.add_argument('''model_type''', type=str, help='''text, coarse or fine.''')
    parser.add_argument('''pytorch_dump_folder_path''', default=None, type=str, help='''Path to the output PyTorch model.''')
    parser.add_argument('''--is_small''', action='''store_true''', help='''convert the small version instead of the large.''')

    __lowercase							 =					parser.parse_args()

    load_model(args.pytorch_dump_folder_path, model_type=args.model_type, use_small=args.is_small)












'''simple docstring'''




import json
import os
import shutil
import tempfile
import unittest

import numpy as np
import pytest

from transformers import CLIPTokenizer, CLIPTokenizerFast
from transformers.models.clip.tokenization_clip import VOCAB_FILES_NAMES
from transformers.testing_utils import require_vision
from transformers.utils import IMAGE_PROCESSOR_NAME, is_vision_available


if is_vision_available():
  from PIL import Image

  from transformers import CLIPImageProcessor, CLIPProcessor


@require_vision
class  SCREAMING_SNAKE_CASE    (unittest.TestCase							):


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Optional[Any]      =       tempfile.mkdtemp()

          # fmt: off
          __A						: Optional[int]      =       ['l', 'o', 'w', 'e', 'r', 's', 't', 'i', 'd', 'n', 'lo', 'l</w>', 'w</w>', 'r</w>', 't</w>', 'low</w>', 'er</w>', 'lowest</w>', 'newer</w>', 'wider', '<unk>', '<|startoftext|>', '<|endoftext|>']
          # fmt: on
          __A						: Tuple      =       dict(zip(_UpperCAmelCase						,	range(len(_UpperCAmelCase))))
          __A						: Any      =       ['#version: 0.2', 'l o', 'lo w</w>', 'e r</w>', '']
          __A						: List[str]      =       {'unk_token': '<unk>'}

          __A						: int      =       os.path.join(self.tmpdirname						,	VOCAB_FILES_NAMES['vocab_file'])
          __A						: Optional[int]      =       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(_UpperCAmelCase) + '\n')
          with open(self.merges_file						,	'w'						,	encoding='utf-8') as fp:
               fp.write('\n'.join(_UpperCAmelCase))

          __A						: str      =       {
              'do_resize': True,
              'size': 20,
              'do_center_crop': True,
              'crop_size': 18,
              'do_normalize': True,
              'image_mean': [0.48145466, 0.4578275, 0.40821073],
              'image_std': [0.26862954, 0.26130258, 0.27577711],
          }
          __A						: Union[str, Any]      =       os.path.join(self.tmpdirname						,	_UpperCAmelCase)
          with open(self.image_processor_file						,	'w'						,	encoding='utf-8') as fp:
               json.dump(_UpperCAmelCase						,	_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self						,	**_UpperCAmelCase):

          '''simple docstring'''






          return CLIPTokenizer.from_pretrained(self.tmpdirname						,	**_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self						,	**_UpperCAmelCase):

          '''simple docstring'''






          return CLIPTokenizerFast.from_pretrained(self.tmpdirname						,	**_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self						,	**_UpperCAmelCase):

          '''simple docstring'''






          return CLIPImageProcessor.from_pretrained(self.tmpdirname						,	**_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          shutil.rmtree(self.tmpdirname)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Tuple      =       [np.random.randint(255						,	size=(3, 30, 400)						,	dtype=np.uinta)]

          __A						: Optional[int]      =       [Image.fromarray(np.moveaxis(_UpperCAmelCase						,	0						,	-1)) for x in image_inputs]

          return image_inputs


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: str      =       self.get_tokenizer()
          __A						: int      =       self.get_rust_tokenizer()
          __A						: Any      =       self.get_image_processor()

          __A						: Union[str, Any]      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)
          processor_slow.save_pretrained(self.tmpdirname)
          __A						: Dict      =       CLIPProcessor.from_pretrained(self.tmpdirname						,	use_fast=_UpperCAmelCase)

          __A						: Union[str, Any]      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)
          processor_fast.save_pretrained(self.tmpdirname)
          __A						: Union[str, Any]      =       CLIPProcessor.from_pretrained(self.tmpdirname)

          self.assertEqual(processor_slow.tokenizer.get_vocab()						,	tokenizer_slow.get_vocab())
          self.assertEqual(processor_fast.tokenizer.get_vocab()						,	tokenizer_fast.get_vocab())
          self.assertEqual(tokenizer_slow.get_vocab()						,	tokenizer_fast.get_vocab())
          self.assertIsInstance(processor_slow.tokenizer						,	_UpperCAmelCase)
          self.assertIsInstance(processor_fast.tokenizer						,	_UpperCAmelCase)

          self.assertEqual(processor_slow.image_processor.to_json_string()						,	image_processor.to_json_string())
          self.assertEqual(processor_fast.image_processor.to_json_string()						,	image_processor.to_json_string())
          self.assertIsInstance(processor_slow.image_processor						,	_UpperCAmelCase)
          self.assertIsInstance(processor_fast.image_processor						,	_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Dict      =       CLIPProcessor(tokenizer=self.get_tokenizer()						,	image_processor=self.get_image_processor())
          processor.save_pretrained(self.tmpdirname)

          __A						: Dict      =       self.get_tokenizer(bos_token='(BOS)'						,	eos_token='(EOS)')
          __A						: Any      =       self.get_image_processor(do_normalize=_UpperCAmelCase						,	padding_value=1.0)

          __A						: Tuple      =       CLIPProcessor.from_pretrained(
              self.tmpdirname						,	bos_token='(BOS)'						,	eos_token='(EOS)'						,	do_normalize=_UpperCAmelCase						,	padding_value=1.0)

          self.assertEqual(processor.tokenizer.get_vocab()						,	tokenizer_add_kwargs.get_vocab())
          self.assertIsInstance(processor.tokenizer						,	_UpperCAmelCase)

          self.assertEqual(processor.image_processor.to_json_string()						,	image_processor_add_kwargs.to_json_string())
          self.assertIsInstance(processor.image_processor						,	_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Optional[int]      =       self.get_image_processor()
          __A						: List[Any]      =       self.get_tokenizer()

          __A						: List[Any]      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)

          __A						: List[str]      =       self.prepare_image_inputs()

          __A						: Dict      =       image_processor(_UpperCAmelCase						,	return_tensors='np')
          __A						: str      =       processor(images=_UpperCAmelCase						,	return_tensors='np')

          for key in input_image_proc.keys():
               self.assertAlmostEqual(input_image_proc[key].sum()						,	input_processor[key].sum()						,	delta=1e-2)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: List[Any]      =       self.get_image_processor()
          __A						: List[str]      =       self.get_tokenizer()

          __A						: Optional[Any]      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)

          __A						: Dict      =       'lower newer'

          __A						: List[Any]      =       processor(text=_UpperCAmelCase)

          __A						: Optional[int]      =       tokenizer(_UpperCAmelCase)

          for key in encoded_tok.keys():
               self.assertListEqual(encoded_tok[key]						,	encoded_processor[key])


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Dict      =       self.get_image_processor()
          __A						: Optional[int]      =       self.get_tokenizer()

          __A						: Optional[Any]      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)

          __A						: int      =       'lower newer'
          __A						: Any      =       self.prepare_image_inputs()

          __A						: Tuple      =       processor(text=_UpperCAmelCase						,	images=_UpperCAmelCase)

          self.assertListEqual(list(inputs.keys())						,	['input_ids', 'attention_mask', 'pixel_values'])

          # test if it raises when no input is passed
          with pytest.raises(_UpperCAmelCase):
               processor()


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Any      =       self.get_image_processor()
          __A						: str      =       self.get_tokenizer()

          __A						: Optional[Any]      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)

          __A						: Dict      =       [[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

          __A						: str      =       processor.batch_decode(_UpperCAmelCase)
          __A						: Optional[Any]      =       tokenizer.batch_decode(_UpperCAmelCase)

          self.assertListEqual(_UpperCAmelCase						,	_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Optional[int]      =       self.get_image_processor()
          __A						: int      =       self.get_tokenizer()

          __A						: Any      =       CLIPProcessor(tokenizer=_UpperCAmelCase						,	image_processor=_UpperCAmelCase)

          __A						: Any      =       'lower newer'
          __A						: Any      =       self.prepare_image_inputs()

          __A						: Any      =       processor(text=_UpperCAmelCase						,	images=_UpperCAmelCase)

          self.assertListEqual(list(inputs.keys())						,	processor.model_input_names)