



'''simple docstring'''







import argparse
import json
from pathlib import Path

import requests
import timm
import torch
from huggingface_hub import hf_hub_download
from PIL import Image

from transformers import AutoImageProcessor, SwinvaConfig, SwinvaForImageClassification

def  lowerCamelCase_					(       A_				):
	__lowerCamelCase		       =		SwinvaConfig()
	__lowerCamelCase		       =		swinva_name.split('''_'''				)

	__lowerCamelCase		       =		name_split[1]
	if "to" in name_split[3]:
		__lowerCamelCase		       =		int(name_split[3][-3:]				)
	else:
		__lowerCamelCase		       =		int(name_split[3]				)
	if "to" in name_split[2]:
		__lowerCamelCase		       =		int(name_split[2][-2:]				)
	else:
		__lowerCamelCase		       =		int(name_split[2][6:]				)

	if model_size == "tiny":
		__lowerCamelCase		       =		96
		__lowerCamelCase		       =		(2, 2, 6, 2)
		__lowerCamelCase		       =		(3, 6, 12, 24)
	elif model_size == "small":
		__lowerCamelCase		       =		96
		__lowerCamelCase		       =		(2, 2, 18, 2)
		__lowerCamelCase		       =		(3, 6, 12, 24)
	elif model_size == "base":
		__lowerCamelCase		       =		1_28
		__lowerCamelCase		       =		(2, 2, 18, 2)
		__lowerCamelCase		       =		(4, 8, 16, 32)
	else:
		__lowerCamelCase		       =		1_92
		__lowerCamelCase		       =		(2, 2, 18, 2)
		__lowerCamelCase		       =		(6, 12, 24, 48)

	if "to" in swinva_name:
		__lowerCamelCase		       =		(12, 12, 12, 6)

	if ("22k" in swinva_name) and ("to" not in swinva_name):
		__lowerCamelCase		       =		2_18_41
		__lowerCamelCase		       =		'''huggingface/label-files'''
		__lowerCamelCase		       =		'''imagenet-22k-id2label.json'''
		__lowerCamelCase		       =		json.load(open(hf_hub_download(A_    ,				A_    ,				repo_type='''dataset'''				)    ,				'''r'''				)				)
		__lowerCamelCase		       =		{int(A_				): v for k, v in idalabel.items()}
		__lowerCamelCase		       =		idalabel
		__lowerCamelCase		       =		{v: k for k, v in idalabel.items()}

	else:
		__lowerCamelCase		       =		10_00
		__lowerCamelCase		       =		'''huggingface/label-files'''
		__lowerCamelCase		       =		'''imagenet-1k-id2label.json'''
		__lowerCamelCase		       =		json.load(open(hf_hub_download(A_    ,				A_    ,				repo_type='''dataset'''				)    ,				'''r'''				)				)
		__lowerCamelCase		       =		{int(A_				): v for k, v in idalabel.items()}
		__lowerCamelCase		       =		idalabel
		__lowerCamelCase		       =		{v: k for k, v in idalabel.items()}

	__lowerCamelCase		       =		img_size
	__lowerCamelCase		       =		num_classes
	__lowerCamelCase		       =		embed_dim
	__lowerCamelCase		       =		depths
	__lowerCamelCase		       =		num_heads
	__lowerCamelCase		       =		window_size

	return config

def  lowerCamelCase_					(       A_				):


	if "patch_embed.proj" in name:
		__lowerCamelCase		       =		name.replace('''patch_embed.proj'''    ,				'''embeddings.patch_embeddings.projection'''				)
	if "patch_embed.norm" in name:
		__lowerCamelCase		       =		name.replace('''patch_embed.norm'''    ,				'''embeddings.norm'''				)
	if "layers" in name:
		__lowerCamelCase		       =		'''encoder.''' + name
	if "attn.proj" in name:
		__lowerCamelCase		       =		name.replace('''attn.proj'''    ,				'''attention.output.dense'''				)
	if "attn" in name:
		__lowerCamelCase		       =		name.replace('''attn'''    ,				'''attention.self'''				)
	if "norm1" in name:
		__lowerCamelCase		       =		name.replace('''norm1'''    ,				'''layernorm_before'''				)
	if "norm2" in name:
		__lowerCamelCase		       =		name.replace('''norm2'''    ,				'''layernorm_after'''				)
	if "mlp.fc1" in name:
		__lowerCamelCase		       =		name.replace('''mlp.fc1'''    ,				'''intermediate.dense'''				)
	if "mlp.fc2" in name:
		__lowerCamelCase		       =		name.replace('''mlp.fc2'''    ,				'''output.dense'''				)
	if "q_bias" in name:
		__lowerCamelCase		       =		name.replace('''q_bias'''    ,				'''query.bias'''				)
	if "k_bias" in name:
		__lowerCamelCase		       =		name.replace('''k_bias'''    ,				'''key.bias'''				)
	if "v_bias" in name:
		__lowerCamelCase		       =		name.replace('''v_bias'''    ,				'''value.bias'''				)
	if "cpb_mlp" in name:
		__lowerCamelCase		       =		name.replace('''cpb_mlp'''    ,				'''continuous_position_bias_mlp'''				)
	if name == "norm.weight":
		__lowerCamelCase		       =		'''layernorm.weight'''
	if name == "norm.bias":
		__lowerCamelCase		       =		'''layernorm.bias'''

	if "head" in name:
		__lowerCamelCase		       =		name.replace('''head'''    ,				'''classifier'''				)
	else:
		__lowerCamelCase		       =		'''swinv2.''' + name

	return name

def  lowerCamelCase_					(       A_    ,				A_				):


	for key in orig_state_dict.copy().keys():
		__lowerCamelCase		       =		orig_state_dict.pop(A_				)

		if "mask" in key:
			continue
		elif "qkv" in key:
			__lowerCamelCase		       =		key.split('''.'''				)
			__lowerCamelCase		       =		int(key_split[1]				)
			__lowerCamelCase		       =		int(key_split[3]				)
			__lowerCamelCase		       =		model.swinva.encoder.layers[layer_num].blocks[block_num].attention.self.all_head_size

			if "weight" in key:
				__lowerCamelCase		       =		val[:dim, :]
				__lowerCamelCase		       =		val[dim : dim * 2, :]
				__lowerCamelCase		       =		val[-dim:, :]
			else:
				__lowerCamelCase		       =		val[:dim]
				__lowerCamelCase		       =		val[
				    dim : dim * 2
				]
				__lowerCamelCase		       =		val[-dim:]
		else:
			__lowerCamelCase		       =		val

	return orig_state_dict

def  lowerCamelCase_					(       A_    ,				A_				):
	__lowerCamelCase		       =		timm.create_model(A_    ,				pretrained=A_				)
	timm_model.eval()

	__lowerCamelCase		       =		get_swinva_config(A_				)
	__lowerCamelCase		       =		SwinvaForImageClassification(A_				)
	model.eval()

	__lowerCamelCase		       =		convert_state_dict(timm_model.state_dict()    ,				A_				)
	model.load_state_dict(A_				)

	__lowerCamelCase		       =		'''http://images.cocodataset.org/val2017/000000039769.jpg'''

	__lowerCamelCase		       =		AutoImageProcessor.from_pretrained('''microsoft/{}'''.format(swinva_name.replace('''_'''    ,				'''-'''				)				)				)
	__lowerCamelCase		       =		Image.open(requests.get(A_    ,				stream=A_				).raw				)
	__lowerCamelCase		       =		image_processor(images=A_    ,				return_tensors='''pt'''				)

	__lowerCamelCase		       =		timm_model(inputs['''pixel_values''']				)
	__lowerCamelCase		       =		model(**A_				).logits

	assert torch.allclose(A_    ,				A_    ,				atol=1e-3				)

	print(f'''Saving model {swinva_name} to {pytorch_dump_folder_path}'''				)
	model.save_pretrained(A_				)

	print(f'''Saving image processor to {pytorch_dump_folder_path}'''				)
	image_processor.save_pretrained(A_				)

	model.push_to_hub(
	    repo_path_or_name=Path(A_    ,				A_				)    ,				organization='''nandwalritik'''    ,				commit_message='''Add model'''    ,				)


if __name__ == "__main__":
				_UpperCamelCase					:  List[str]        =argparse.ArgumentParser()
				# Required parameters
				parser.add_argument(
				    "--swinv2_name",
				    default="swinv2_tiny_patch4_window8_256",
				    type=str,
				    help="Name of the Swinv2 timm model you\'d like to convert.",
				)
				parser.add_argument(
				    "--pytorch_dump_folder_path", default=None, type=str, help="Path to the output PyTorch model directory."
				)

				_UpperCamelCase					:  int        =parser.parse_args()
				convert_swinva_checkpoint(args.swinva_name, args.pytorch_dump_folder_path)







'''simple docstring'''


import re
import string
from collections import Counter

import sacrebleu
import sacremoses
from packaging import version

import datasets


_snake_case : Any  				=						'\n@inproceedings{xu-etal-2016-optimizing,\n    title = {Optimizing Statistical Machine Translation for Text Simplification},\n    authors={Xu, Wei and Napoles, Courtney and Pavlick, Ellie and Chen, Quanze and Callison-Burch, Chris},\n    journal = {Transactions of the Association for Computational Linguistics},\n    volume = {4},\n    year={2016},\n    url = {https://www.aclweb.org/anthology/Q16-1029},\n    pages = {401--415\n},\n@inproceedings{post-2018-call,\n    title = "A Call for Clarity in Reporting {BLEU} Scores",\n    author = "Post, Matt",\n    booktitle = "Proceedings of the Third Conference on Machine Translation: Research Papers",\n    month = oct,\n    year = "2018",\n    address = "Belgium, Brussels",\n    publisher = "Association for Computational Linguistics",\n    url = "https://www.aclweb.org/anthology/W18-6319",\n    pages = "186--191",\n}\n'

_snake_case : Any  				=						'\\nWIKI_SPLIT is the combination of three metrics SARI, EXACT and SACREBLEU\nIt can be used to evaluate the quality of machine-generated texts.\n'


_snake_case : List[Any]  				=						'\nCalculates sari score (between 0 and 100) given a list of source and predicted\nsentences, and a list of lists of reference sentences. It also computes the BLEU score as well as the exact match score.\nArgs:\n    sources: list of source sentences where each sentence should be a string.\n    predictions: list of predicted sentences where each sentence should be a string.\n    references: list of lists of reference sentences where each sentence should be a string.\nReturns:\n    sari: sari score\n    sacrebleu: sacrebleu score\n    exact: exact score\n\nExamples:\n    >>> sources=["About 95 species are currently accepted ."]\n    >>> predictions=["About 95 you now get in ."]\n    >>> references=[["About 95 species are currently known ."]]\n    >>> wiki_split = datasets.load_metric("wiki_split")\n    >>> results = wiki_split.compute(sources=sources, predictions=predictions, references=references)\n    >>> print(results)\n    {\'sari\': 21.805555555555557, \'sacrebleu\': 14.535768424205482, \'exact\': 0.0}\n'
def 						snake_case_       (UpperCamelCase			:    Tuple ):





							'''simple docstring'''


							def remove_articles(UpperCamelCase			:    Optional[int] ):
														_a      	=							re.compile(R'''\b(a|an|the)\b'''					,		re.UNICODE )
														return re.sub(UpperCamelCase					,		''' '''					,		UpperCamelCase )

							def white_space_fix(UpperCamelCase			:    Union[str, Any] ):
														return " ".join(text.split() )

							def remove_punc(UpperCamelCase			:    str ):
														_a      	=							set(string.punctuation )
														return "".join(ch for ch in text if ch not in exclude )

							def lower(UpperCamelCase			:    Tuple ):
														return text.lower()

							return white_space_fix(remove_articles(remove_punc(lower(UpperCamelCase ) ) ) )
def 						snake_case_       (UpperCamelCase			:    int					,		UpperCamelCase			:    Dict ):





							'''simple docstring'''


							return int(normalize_answer(UpperCamelCase ) == normalize_answer(UpperCamelCase ) )
def 						snake_case_       (UpperCamelCase			:    List[str]					,		UpperCamelCase			:    List[str] ):





							'''simple docstring'''


							_a      	=							[any(compute_exact(UpperCamelCase					,		UpperCamelCase ) for ref in refs ) for pred, refs in zip(UpperCamelCase					,		UpperCamelCase )]
							return (sum(UpperCamelCase ) / len(UpperCamelCase )) * 100
def 						snake_case_       (UpperCamelCase			:    Any					,		UpperCamelCase			:    Union[str, Any]					,		UpperCamelCase			:    Dict					,		UpperCamelCase			:    Union[str, Any] ):





							'''simple docstring'''


							_a      	=							[rgram for rgrams in rgramslist for rgram in rgrams]
							_a      	=							Counter(UpperCamelCase )

							_a      	=							Counter(UpperCamelCase )
							_a      	=							Counter()
							for sgram, scount in sgramcounter.items():
														_a      	=							scount * numref

							_a      	=							Counter(UpperCamelCase )
							_a      	=							Counter()
							for cgram, ccount in cgramcounter.items():
														_a      	=							ccount * numref

							# KEEP
							_a      	=							sgramcounter_rep & cgramcounter_rep
							_a      	=							keepgramcounter_rep & rgramcounter
							_a      	=							sgramcounter_rep & rgramcounter

							_a      	=							0
							_a      	=							0
							for keepgram in keepgramcountergood_rep:
														keeptmpscorea += keepgramcountergood_rep[keepgram] / keepgramcounter_rep[keepgram]
														# Fix an alleged bug [2] in the keep score computation.
														# keeptmpscore2 += keepgramcountergood_rep[keepgram] / keepgramcounterall_rep[keepgram]
														keeptmpscorea += keepgramcountergood_rep[keepgram]
							# Define 0/0=1 instead of 0 to give higher scores for predictions that match
							#      a target exactly.
							_a      	=							1
							_a      	=							1
							if len(UpperCamelCase ) > 0:
														_a      	=							keeptmpscorea / len(UpperCamelCase )
							if len(UpperCamelCase ) > 0:
														# Fix an alleged bug [2] in the keep score computation.
														# keepscore_recall = keeptmpscore2 / len(keepgramcounterall_rep)
														_a      	=							keeptmpscorea / sum(keepgramcounterall_rep.values() )
							_a      	=							0
							if keepscore_precision > 0 or keepscore_recall > 0:
														_a      	=							2 * keepscore_precision * keepscore_recall / (keepscore_precision + keepscore_recall)

							# DELETION
							_a      	=							sgramcounter_rep - cgramcounter_rep
							_a      	=							delgramcounter_rep - rgramcounter
							_a      	=							sgramcounter_rep - rgramcounter
							_a      	=							0
							_a      	=							0
							for delgram in delgramcountergood_rep:
														deltmpscorea += delgramcountergood_rep[delgram] / delgramcounter_rep[delgram]
														deltmpscorea += delgramcountergood_rep[delgram] / delgramcounterall_rep[delgram]
							# Define 0/0=1 instead of 0 to give higher scores for predictions that match
							# a target exactly.
							_a      	=							1
							if len(UpperCamelCase ) > 0:
														_a      	=							deltmpscorea / len(UpperCamelCase )

							# ADDITION
							_a      	=							set(UpperCamelCase ) - set(UpperCamelCase )
							_a      	=							set(UpperCamelCase ) & set(UpperCamelCase )
							_a      	=							set(UpperCamelCase ) - set(UpperCamelCase )

							_a      	=							0
							for addgram in addgramcountergood:
														addtmpscore += 1

							# Define 0/0=1 instead of 0 to give higher scores for predictions that match
							# a target exactly.
							_a      	=							1
							_a      	=							1
							if len(UpperCamelCase ) > 0:
														_a      	=							addtmpscore / len(UpperCamelCase )
							if len(UpperCamelCase ) > 0:
														_a      	=							addtmpscore / len(UpperCamelCase )
							_a      	=							0
							if addscore_precision > 0 or addscore_recall > 0:
														_a      	=							2 * addscore_precision * addscore_recall / (addscore_precision + addscore_recall)

							return (keepscore, delscore_precision, addscore)
def 						snake_case_       (UpperCamelCase			:    Union[str, Any]					,		UpperCamelCase			:    List[Any]					,		UpperCamelCase			:    Optional[int] ):





							'''simple docstring'''


							_a      	=							len(UpperCamelCase )

							_a      	=							ssent.split(''' ''' )
							_a      	=							csent.split(''' ''' )
							_a      	=							[]
							_a      	=							[]
							_a      	=							[]
							_a      	=							[]
							_a      	=							[]
							_a      	=							[]

							_a      	=							[]
							_a      	=							[]
							_a      	=							[]
							_a      	=							[]
							for rsent in rsents:
														_a      	=							rsent.split(''' ''' )
														_a      	=							[]
														_a      	=							[]
														_a      	=							[]
														ragramslist.append(UpperCamelCase )
														for i in range(0					,		len(UpperCamelCase ) - 1 ):
																					if i < len(UpperCamelCase ) - 1:
																												_a      	=							ragrams[i] + ''' ''' + ragrams[i + 1]
																												ragrams.append(UpperCamelCase )
																					if i < len(UpperCamelCase ) - 2:
																												_a      	=							ragrams[i] + ''' ''' + ragrams[i + 1] + ''' ''' + ragrams[i + 2]
																												ragrams.append(UpperCamelCase )
																					if i < len(UpperCamelCase ) - 3:
																												_a      	=							ragrams[i] + ''' ''' + ragrams[i + 1] + ''' ''' + ragrams[i + 2] + ''' ''' + ragrams[i + 3]
																												ragrams.append(UpperCamelCase )
														ragramslist.append(UpperCamelCase )
														ragramslist.append(UpperCamelCase )
														ragramslist.append(UpperCamelCase )

							for i in range(0					,		len(UpperCamelCase ) - 1 ):
														if i < len(UpperCamelCase ) - 1:
																					_a      	=							sagrams[i] + ''' ''' + sagrams[i + 1]
																					sagrams.append(UpperCamelCase )
														if i < len(UpperCamelCase ) - 2:
																					_a      	=							sagrams[i] + ''' ''' + sagrams[i + 1] + ''' ''' + sagrams[i + 2]
																					sagrams.append(UpperCamelCase )
														if i < len(UpperCamelCase ) - 3:
																					_a      	=							sagrams[i] + ''' ''' + sagrams[i + 1] + ''' ''' + sagrams[i + 2] + ''' ''' + sagrams[i + 3]
																					sagrams.append(UpperCamelCase )

							for i in range(0					,		len(UpperCamelCase ) - 1 ):
														if i < len(UpperCamelCase ) - 1:
																					_a      	=							cagrams[i] + ''' ''' + cagrams[i + 1]
																					cagrams.append(UpperCamelCase )
														if i < len(UpperCamelCase ) - 2:
																					_a      	=							cagrams[i] + ''' ''' + cagrams[i + 1] + ''' ''' + cagrams[i + 2]
																					cagrams.append(UpperCamelCase )
														if i < len(UpperCamelCase ) - 3:
																					_a      	=							cagrams[i] + ''' ''' + cagrams[i + 1] + ''' ''' + cagrams[i + 2] + ''' ''' + cagrams[i + 3]
																					cagrams.append(UpperCamelCase )

							((_a)	,				(_a)	,				(_a))      	=							SARIngram(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )
							((_a)	,				(_a)	,				(_a))      	=							SARIngram(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )
							((_a)	,				(_a)	,				(_a))      	=							SARIngram(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )
							((_a)	,				(_a)	,				(_a))      	=							SARIngram(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )
							_a      	=							sum([keepascore, keepascore, keepascore, keepascore] ) / 4
							_a      	=							sum([delascore, delascore, delascore, delascore] ) / 4
							_a      	=							sum([addascore, addascore, addascore, addascore] ) / 4
							_a      	=							(avgkeepscore + avgdelscore + avgaddscore) / 3
							return finalscore
def 						snake_case_       (UpperCamelCase			:    str					,		UpperCamelCase			:    bool = True					,		UpperCamelCase			:    str = "13a"					,		UpperCamelCase			:    bool = True ):





							'''simple docstring'''


							if lowercase:
														_a      	=							sentence.lower()

							if tokenizer in ["13a", "intl"]:
														if version.parse(sacrebleu.__version__ ).major >= 2:
																					_a      	=							sacrebleu.metrics.bleu._get_tokenizer(UpperCamelCase )()(UpperCamelCase )
														else:
																					_a      	=							sacrebleu.TOKENIZERS[tokenizer]()(UpperCamelCase )
							elif tokenizer == "moses":
														_a      	=							sacremoses.MosesTokenizer().tokenize(UpperCamelCase					,		return_str=UpperCamelCase					,		escape=UpperCamelCase )
							elif tokenizer == "penn":
														_a      	=							sacremoses.MosesTokenizer().penn_tokenize(UpperCamelCase					,		return_str=UpperCamelCase )
							else:
														_a      	=							sentence

							if not return_str:
														_a      	=							normalized_sent.split()

							return normalized_sent
def 						snake_case_       (UpperCamelCase			:    int					,		UpperCamelCase			:    int					,		UpperCamelCase			:    Dict ):





							'''simple docstring'''


							if not (len(UpperCamelCase ) == len(UpperCamelCase ) == len(UpperCamelCase )):
														raise ValueError('''Sources length must match predictions and references lengths.''' )
							_a      	=							0
							for src, pred, refs in zip(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase ):
														sari_score += SARIsent(normalize(UpperCamelCase )					,		normalize(UpperCamelCase )					,		[normalize(UpperCamelCase ) for sent in refs] )
							_a      	=							sari_score / len(UpperCamelCase )
							return 100 * sari_score
def 						snake_case_       (UpperCamelCase			:    Dict					,		UpperCamelCase			:    Tuple					,		UpperCamelCase			:    List[str]="exp"					,		UpperCamelCase			:    List[Any]=None					,		UpperCamelCase			:    Optional[int]=False					,		UpperCamelCase			:    Union[str, Any]=False					,		UpperCamelCase			:    Optional[int]=False					,		):





							'''simple docstring'''


							_a      	=							len(references[0] )
							if any(len(UpperCamelCase ) != references_per_prediction for refs in references ):
														raise ValueError('''Sacrebleu requires the same number of references for each prediction''' )
							_a      	=							[[refs[i] for refs in references] for i in range(UpperCamelCase )]
							_a      	=							sacrebleu.corpus_bleu(
							    UpperCamelCase					,		UpperCamelCase					,		smooth_method=UpperCamelCase					,		smooth_value=UpperCamelCase					,		force=UpperCamelCase					,		lowercase=UpperCamelCase					,		use_effective_order=UpperCamelCase					,		)
							return output.score

@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION	,_KWARGS_DESCRIPTION       )
class      A       (						datasets.Metric       ):







							def   __lowerCAmelCase     (    self			:    Tuple   )     ->				Dict:


														"""simple docstring"""


														return datasets.MetricInfo(
														    description=_DESCRIPTION				,     citation=_CITATION				,     inputs_description=_KWARGS_DESCRIPTION				,     features=datasets.Features(
														        {
														            '''predictions''': datasets.Value('''string'''				,     id='''sequence'''   ),
														            '''references''': datasets.Sequence(datasets.Value('''string'''				,     id='''sequence'''   )				,     id='''references'''   ),
														        }   )				,     codebase_urls=[
														        '''https://github.com/huggingface/transformers/blob/master/src/transformers/data/metrics/squad_metrics.py''',
														        '''https://github.com/cocoxu/simplification/blob/master/SARI.py''',
														        '''https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/sari_hook.py''',
														        '''https://github.com/mjpost/sacreBLEU''',
														    ]				,     reference_urls=[
														        '''https://www.aclweb.org/anthology/Q16-1029.pdf''',
														        '''https://github.com/mjpost/sacreBLEU''',
														        '''https://en.wikipedia.org/wiki/BLEU''',
														        '''https://towardsdatascience.com/evaluating-text-output-in-nlp-bleu-at-your-own-risk-e8609665a213''',
														    ]				,     )







							def   __lowerCAmelCase     (    self			:    int				,     lowerCAmelCase_			:    Optional[int]				,     lowerCAmelCase_			:    Union[str, Any]				,     lowerCAmelCase_			:    Any   )     ->				Dict:


														"""simple docstring"""


														_a      	=							{}
														result.update({'''sari''': compute_sari(sources=lowerCAmelCase_				,     predictions=lowerCAmelCase_				,     references=lowerCAmelCase_   )}   )
														result.update({'''sacrebleu''': compute_sacrebleu(predictions=lowerCAmelCase_				,     references=lowerCAmelCase_   )}   )
														result.update({'''exact''': compute_em(predictions=lowerCAmelCase_				,     references=lowerCAmelCase_   )}   )
														return result

