





"""simple docstring"""






from __future__ import annotations

import copy
import inspect
import json
import math
import os
import tempfile
import unittest
from importlib import import_module

import numpy as np

from transformers import ViTMAEConfig
from transformers.file_utils import cached_property, is_tf_available, is_vision_available
from transformers.testing_utils import require_tf, require_vision, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
  import tensorflow as tf

  from transformers import TFViTMAEForPreTraining, TFViTMAEModel


if is_vision_available():
  from PIL import Image

  from transformers import ViTImageProcessor




class 			__lowercase     :







     '''simple docstring'''




     def __init__(  self		,     _UpperCAmelCase		,     _UpperCAmelCase=13		,     _UpperCAmelCase=30		,     _UpperCAmelCase=2		,     _UpperCAmelCase=3		,     _UpperCAmelCase=True		,     _UpperCAmelCase=True		,     _UpperCAmelCase=32		,     _UpperCAmelCase=2		,     _UpperCAmelCase=4		,     _UpperCAmelCase=37		,     _UpperCAmelCase="gelu"		,     _UpperCAmelCase=0.1		,     _UpperCAmelCase=0.1		,     _UpperCAmelCase=10		,     _UpperCAmelCase=0.0_2		,     _UpperCAmelCase=3		,     _UpperCAmelCase=0.6		,     _UpperCAmelCase=None		,     ):
         __a	:  Optional[int]         =					parent
         __a	:  Any         =					batch_size
         __a	:  Any         =					image_size
         __a	:  Union[str, Any]         =					patch_size
         __a	:  Tuple         =					num_channels
         __a	:  Tuple         =					is_training
         __a	:  Union[str, Any]         =					use_labels
         __a	:  Optional[int]         =					hidden_size
         __a	:  Tuple         =					num_hidden_layers
         __a	:  str         =					num_attention_heads
         __a	:  Dict         =					intermediate_size
         __a	:  List[Any]         =					hidden_act
         __a	:  Union[str, Any]         =					hidden_dropout_prob
         __a	:  Any         =					attention_probs_dropout_prob
         __a	:  Tuple         =					type_sequence_label_size
         __a	:  Optional[int]         =					initializer_range
         __a	:  List[Any]         =					mask_ratio
         __a	:  Dict         =					scope

         # in ViTMAE, the expected sequence length = (num_patches + 1) * (1 - config.mask_ratio), rounded above
         # (we add 1 for the [CLS] token)
         __a	:  List[str]         =					(image_size // patch_size) ** 2
         __a	:  str         =					int(math.ceil((1 - mask_ratio) * (num_patches + 1)       )       )







     def 	_lowerCamelCase						(  self       ):
         __a	:  str         =					floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]       )

         __a	:  List[Any]         =					None
         if self.use_labels:
             __a	:  Dict         =					ids_tensor([self.batch_size]		,     self.type_sequence_label_size       )

         __a	:  Union[str, Any]         =					self.get_config()

         return config, pixel_values, labels







     def 	_lowerCamelCase						(  self       ):
         return ViTMAEConfig(
             image_size=self.image_size		,     patch_size=self.patch_size		,     num_channels=self.num_channels		,     hidden_size=self.hidden_size		,     num_hidden_layers=self.num_hidden_layers		,     num_attention_heads=self.num_attention_heads		,     intermediate_size=self.intermediate_size		,     decoder_hidden_size=self.hidden_size		,     decoder_num_hidden_layers=self.num_hidden_layers		,     decoder_num_attention_heads=self.num_attention_heads		,     decoder_intermediate_size=self.intermediate_size		,     hidden_act=self.hidden_act		,     hidden_dropout_prob=self.hidden_dropout_prob		,     attention_probs_dropout_prob=self.attention_probs_dropout_prob		,     is_decoder=_lowerCamelCase		,     initializer_range=self.initializer_range		,     mask_ratio=self.mask_ratio		,     )







     def 	_lowerCamelCase						(  self		,     _UpperCAmelCase		,     _UpperCAmelCase		,     _UpperCAmelCase       ):
         __a	:  Union[str, Any]         =					TFViTMAEModel(config=_lowerCamelCase       )
         __a	:  List[Any]         =					model(_lowerCamelCase		,     training=_lowerCamelCase       )
         self.parent.assertEqual(result.last_hidden_state.shape		,     (self.batch_size, self.seq_length, self.hidden_size)       )







     def 	_lowerCamelCase						(  self		,     _UpperCAmelCase		,     _UpperCAmelCase		,     _UpperCAmelCase       ):
         __a	:  Any         =					TFViTMAEForPreTraining(_lowerCamelCase       )
         __a	:  List[str]         =					model(_lowerCamelCase		,     training=_lowerCamelCase       )
         # expected sequence length = num_patches
         __a	:  int         =					(self.image_size // self.patch_size) ** 2
         __a	:  int         =					self.patch_size**2 * self.num_channels
         self.parent.assertEqual(result.logits.shape		,     (self.batch_size, num_patches, expected_num_channels)       )

         # test greyscale images
         __a	:  str         =					1
         __a	:  Dict         =					TFViTMAEForPreTraining(_lowerCamelCase       )

         __a	:  Tuple         =					floats_tensor([self.batch_size, 1, self.image_size, self.image_size]       )
         __a	:  Optional[Any]         =					model(_lowerCamelCase		,     training=_lowerCamelCase       )
         __a	:  Tuple         =					self.patch_size**2
         self.parent.assertEqual(result.logits.shape		,     (self.batch_size, num_patches, expected_num_channels)       )







     def 	_lowerCamelCase						(  self       ):
         __a	:  Tuple         =					self.prepare_config_and_inputs()
         (__a)	:  List[str]         =					config_and_inputs
         __a	:  Tuple         =					{'''pixel_values''': pixel_values}
         return config, inputs_dict






@require_tf
class 			__lowercase     (     a__				, a__				, unittest.TestCase							):







     '''simple docstring'''




     __lowerCAmelCase					=					(TFViTMAEModel, TFViTMAEForPreTraining) if is_tf_available() else ()
     __lowerCAmelCase					=					{'''feature-extraction''': TFViTMAEModel} if is_tf_available() else {}

     __lowerCAmelCase					=					False
     __lowerCAmelCase					=					False
     __lowerCAmelCase					=					False
     __lowerCAmelCase					=					False







     def 	_lowerCamelCase						(  self       ):
         __a	:  List[str]         =					TFViTMAEModelTester(self       )
         __a	:  Optional[Any]         =					ConfigTester(self		,     config_class=_lowerCamelCase		,     has_text_modality=_lowerCamelCase		,     hidden_size=37       )







     def 	_lowerCamelCase						(  self       ):
         self.config_tester.run_common_tests()







     @unittest.skip(reason='''ViTMAE does not use inputs_embeds'''       )
     def 	_lowerCamelCase						(  self       ):
         pass







     def 	_lowerCamelCase						(  self       ):
         __a	:  List[str]         =					self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
             __a	:  Tuple         =					model_class(_lowerCamelCase       )
             self.assertIsInstance(model.get_input_embeddings()		,     (tf.keras.layers.Layer)       )
             __a	:  Union[str, Any]         =					model.get_output_embeddings()
             self.assertTrue(x is None or isinstance(_lowerCamelCase		,     tf.keras.layers.Layer       )       )







     def 	_lowerCamelCase						(  self       ):
         __a	:  str         =					self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
             __a	:  int         =					model_class(_lowerCamelCase       )
             __a	:  Any         =					inspect.signature(model.call       )
             # signature.parameters is an OrderedDict => so arg_names order is deterministic
             __a	:  List[Any]         =					[*signature.parameters.keys()]

             __a	:  int         =					['''pixel_values''']
             self.assertListEqual(arg_names[:1]		,     _lowerCamelCase       )







     def 	_lowerCamelCase						(  self       ):
         __a	:  Dict         =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*_lowerCamelCase       )







     def 	_lowerCamelCase						(  self       ):
         __a	:  Any         =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_pretraining(*_lowerCamelCase       )







     def 	_lowerCamelCase						(  self       ):
         np.random.seed(2       )

         __a	:  str         =					self.model_tester.prepare_config_and_inputs_for_common()

         __a	:  Any         =					int((config.image_size // config.patch_size) ** 2       )
         __a	:  Any         =					np.random.uniform(size=(self.model_tester.batch_size, num_patches)       )

         for model_class in self.all_model_classes:
             __a	:  List[str]         =					model_class(_lowerCamelCase       )
             __a	:  Tuple         =					self._prepare_for_class(_lowerCamelCase		,     _lowerCamelCase       )

             __a	:  Tuple         =					model(_lowerCamelCase		,     noise=_lowerCamelCase       )

             __a	:  List[str]         =					copy.deepcopy(self._prepare_for_class(_lowerCamelCase		,     _lowerCamelCase       )       )
             __a	:  Any         =					model(**_lowerCamelCase		,     noise=_lowerCamelCase       )
             __a	:  Optional[Any]         =					outputs_dict[0].numpy()
             __a	:  Optional[Any]         =					outputs_keywords[0].numpy()

             self.assertLess(np.sum(np.abs(output_dict - output_keywords       )       )		,     1e-6       )







     def 	_lowerCamelCase						(  self       ):
         np.random.seed(2       )

         __a	:  str         =					self.model_tester.prepare_config_and_inputs_for_common()

         __a	:  str         =					int((config.image_size // config.patch_size) ** 2       )
         __a	:  Dict         =					np.random.uniform(size=(self.model_tester.batch_size, num_patches)       )

         def prepare_numpy_arrays(_UpperCAmelCase       ):
             __a	:  Any         =					{}
             for k, v in inputs_dict.items():
                 if tf.is_tensor(_lowerCamelCase       ):
                     __a	:  Dict         =					v.numpy()
                 else:
                     __a	:  Union[str, Any]         =					np.array(_lowerCamelCase       )

             return inputs_np_dict

         for model_class in self.all_model_classes:
             __a	:  List[str]         =					model_class(_lowerCamelCase       )

             __a	:  List[Any]         =					self._prepare_for_class(_lowerCamelCase		,     _lowerCamelCase       )
             __a	:  int         =					prepare_numpy_arrays(_lowerCamelCase       )

             __a	:  str         =					model(_lowerCamelCase		,     noise=_lowerCamelCase       )
             __a	:  Union[str, Any]         =					model(**_lowerCamelCase		,     noise=_lowerCamelCase       )
             self.assert_outputs_same(_lowerCamelCase		,     _lowerCamelCase       )







     def 	_lowerCamelCase						(  self		,     _UpperCAmelCase		,     _UpperCAmelCase		,     _UpperCAmelCase       ):
         np.random.seed(2       )

         __a	:  List[Any]         =					int((tf_model.config.image_size // tf_model.config.patch_size) ** 2       )
         __a	:  int         =					np.random.uniform(size=(self.model_tester.batch_size, num_patches)       )
         __a	:  List[Any]         =					tf.constant(_lowerCamelCase       )

         # Add `noise` argument.
         # PT inputs will be prepared in `super().check_pt_tf_models()` with this added `noise` argument
         __a	:  str         =					tf_noise

         super().check_pt_tf_models(_lowerCamelCase		,     _lowerCamelCase		,     _lowerCamelCase       )







     def 	_lowerCamelCase						(  self       ):
         np.random.seed(2       )

         __a	:  int         =					self.model_tester.prepare_config_and_inputs_for_common()

         __a	:  Dict         =					{
             module_member
             for model_class in self.all_model_classes
             for module in (import_module(model_class.__module__       ),)
             for module_member_name in dir(_lowerCamelCase       )
             if module_member_name.endswith('''MainLayer'''       )
             # This condition is required, since `modeling_tf_clip.py` has 3 classes whose names end with `MainLayer`.
             and module_member_name[: -len('''MainLayer'''       )] == model_class.__name__[: -len('''Model'''       )]
             for module_member in (getattr(_lowerCamelCase		,     _lowerCamelCase       ),)
             if isinstance(_lowerCamelCase		,     _lowerCamelCase       )
             and tf.keras.layers.Layer in module_member.__bases__
             and getattr(_lowerCamelCase		,     '''_keras_serializable'''		,     _lowerCamelCase       )
         }

         __a	:  List[Any]         =					int((config.image_size // config.patch_size) ** 2       )
         __a	:  Union[str, Any]         =					np.random.uniform(size=(self.model_tester.batch_size, num_patches)       )
         __a	:  Any         =					tf.convert_to_tensor(_lowerCamelCase       )
         inputs_dict.update({'''noise''': noise}       )

         for main_layer_class in tf_main_layer_classes:
             __a	:  Optional[Any]         =					main_layer_class(_lowerCamelCase       )

             __a	:  List[Any]         =					{
                 name: tf.keras.Input(tensor.shape[1:]		,     dtype=tensor.dtype       ) for name, tensor in inputs_dict.items()
             }

             __a	:  Tuple         =					tf.keras.Model(_lowerCamelCase		,     outputs=main_layer(_lowerCamelCase       )       )
             __a	:  Dict         =					model(_lowerCamelCase       )

             with tempfile.TemporaryDirectory() as tmpdirname:
                 __a	:  List[Any]         =					os.path.join(_lowerCamelCase		,     '''keras_model.h5'''       )
                 model.save(_lowerCamelCase       )
                 __a	:  Any         =					tf.keras.models.load_model(
                     _lowerCamelCase		,     custom_objects={main_layer_class.__name__: main_layer_class}       )
                 assert isinstance(_lowerCamelCase		,     tf.keras.Model       )
                 __a	:  Optional[int]         =					model(_lowerCamelCase       )
                 self.assert_outputs_same(_lowerCamelCase		,     _lowerCamelCase       )







     @slow
     def 	_lowerCamelCase						(  self       ):
         np.random.seed(2       )

         __a	:  Optional[int]         =					self.model_tester.prepare_config_and_inputs_for_common()

         __a	:  Union[str, Any]         =					int((config.image_size // config.patch_size) ** 2       )
         __a	:  int         =					np.random.uniform(size=(self.model_tester.batch_size, num_patches)       )

         for model_class in self.all_model_classes:
             __a	:  Any         =					model_class(_lowerCamelCase       )
             __a	:  List[Any]         =					self._prepare_for_class(_lowerCamelCase		,     _lowerCamelCase       )
             __a	:  Optional[Any]         =					model(_lowerCamelCase		,     noise=_lowerCamelCase       )

             if model_class.__name__ == "TFViTMAEModel":
                 __a	:  Dict         =					outputs.last_hidden_state.numpy()
                 __a	:  List[Any]         =					0
             else:
                 __a	:  Any         =					outputs.logits.numpy()
                 __a	:  List[Any]         =					0

             with tempfile.TemporaryDirectory() as tmpdirname:
                 model.save_pretrained(_lowerCamelCase		,     saved_model=_lowerCamelCase       )
                 __a	:  List[Any]         =					model_class.from_pretrained(_lowerCamelCase       )
                 __a	:  Any         =					model(_lowerCamelCase		,     noise=_lowerCamelCase       )

                 if model_class.__name__ == "TFViTMAEModel":
                     __a	:  List[Any]         =					after_outputs['''last_hidden_state'''].numpy()
                     __a	:  Optional[Any]         =					0
                 else:
                     __a	:  Dict         =					after_outputs['''logits'''].numpy()
                     __a	:  Dict         =					0

                 __a	:  List[Any]         =					np.amax(np.abs(out_a - out_a       )       )
                 self.assertLessEqual(_lowerCamelCase		,     1e-5       )







     def 	_lowerCamelCase						(  self       ):
         np.random.seed(2       )

         __a	:  List[str]         =					self.model_tester.prepare_config_and_inputs_for_common()

         __a	:  int         =					int((config.image_size // config.patch_size) ** 2       )
         __a	:  Dict         =					np.random.uniform(size=(self.model_tester.batch_size, num_patches)       )

         for model_class in self.all_model_classes:
             __a	:  List[Any]         =					model_class(_lowerCamelCase       )
             __a	:  str         =					self._prepare_for_class(_lowerCamelCase		,     _lowerCamelCase       )

             __a	:  str         =					model(_lowerCamelCase		,     noise=_lowerCamelCase       )
             __a	:  Optional[Any]         =					model.get_config()
             # make sure that returned config is jsonifiable, which is required by keras
             json.dumps(_lowerCamelCase       )
             __a	:  Optional[int]         =					model_class.from_config(model.get_config()       )
             # make sure it also accepts a normal config
             __a	:  Any         =					model_class.from_config(model.config       )
             __a	:  int         =					new_model(_lowerCamelCase       )  # Build model
             new_model.set_weights(model.get_weights()       )
             __a	:  Dict         =					new_model(_lowerCamelCase		,     noise=_lowerCamelCase       )

             self.assert_outputs_same(_lowerCamelCase		,     _lowerCamelCase       )







     @unittest.skip(
         reason='''ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load
    to get deterministic results.'''       )
     def 	_lowerCamelCase						(  self       ):
         pass







     @unittest.skip(reason='''ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load'''       )
     def 	_lowerCamelCase						(  self       ):
         pass







     @slow
     def 	_lowerCamelCase						(  self       ):
         __a	:  Tuple         =					TFViTMAEModel.from_pretrained('''google/vit-base-patch16-224'''       )
         self.assertIsNotNone(_lowerCamelCase       )






def       __A (     )						->						List[str]:
    __a	:  Optional[int]         =					Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png''')
    return image






@require_tf
@require_vision
class 			__lowercase     (     unittest.TestCase							):







     '''simple docstring'''




     @cached_property
     def 	_lowerCamelCase						(  self       ):
         return ViTImageProcessor.from_pretrained('''facebook/vit-mae-base'''       ) if is_vision_available() else None







     @slow
     def 	_lowerCamelCase						(  self       ):
         np.random.seed(2       )

         __a	:  List[str]         =					TFViTMAEForPreTraining.from_pretrained('''facebook/vit-mae-base'''       )

         __a	:  str         =					self.default_image_processor
         __a	:  Dict         =					prepare_img()
         __a	:  Union[str, Any]         =					image_processor(images=_lowerCamelCase		,     return_tensors='''tf'''       )

         # prepare a noise vector that will be also used for testing the TF model
         # (this way we can ensure that the PT and TF models operate on the same inputs)
         __a	:  Tuple         =					ViTMAEConfig()
         __a	:  List[str]         =					int((vit_mae_config.image_size // vit_mae_config.patch_size) ** 2       )
         __a	:  Optional[Any]         =					np.random.uniform(size=(1, num_patches)       )

         # forward pass
         __a	:  Union[str, Any]         =					model(**_lowerCamelCase		,     noise=_lowerCamelCase       )

         # verify the logits
         __a	:  Dict         =					tf.convert_to_tensor([1, 196, 768]       )
         self.assertEqual(outputs.logits.shape		,     _lowerCamelCase       )

         __a	:  Dict         =					tf.convert_to_tensor(
             [[-0.0_5_4_8, -1.7_0_2_3, -0.9_3_2_5], [0.3_7_2_1, -0.5_6_7_0, -0.2_2_3_3], [0.8_2_3_5, -1.3_8_7_8, -0.3_5_2_4]]       )

         tf.debugging.assert_near(outputs.logits[0, :3, :3]		,     _lowerCamelCase		,     atol=1e-4       )






"""simple docstring"""






import comet  # From: unbabel-comet
import torch

import datasets


A	     =					datasets.logging.get_logger(__name__)

A	     =					'''\
@inproceedings{rei-EtAl:2020:WMT,
   author    = {Rei, Ricardo  and  Stewart, Craig  and  Farinha, Ana C  and  Lavie, Alon},
   title     = {Unbabel\'s Participation in the WMT20 Metrics Shared Task},
   booktitle      = {Proceedings of the Fifth Conference on Machine Translation},
   month          = {November},
   year           = {2020},
   address        = {Online},
   publisher      = {Association for Computational Linguistics},
   pages     = {909--918},
}
@inproceedings{rei-etal-2020-comet,
   title = "{COMET}: A Neural Framework for {MT} Evaluation",
   author = "Rei, Ricardo  and
      Stewart, Craig  and
      Farinha, Ana C  and
      Lavie, Alon",
   booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
   month = nov,
   year = "2020",
   address = "Online",
   publisher = "Association for Computational Linguistics",
   url = "https://www.aclweb.org/anthology/2020.emnlp-main.213",
   pages = "2685--2702",
}
'''

A	     =					'''\
Crosslingual Optimized Metric for Evaluation of Translation (COMET) is an open-source framework used to train Machine Translation metrics that achieve high levels of correlation with different types of human judgments (HTER, DA\'s or MQM).
With the release of the framework the authors also released fully trained models that were used to compete in the WMT20 Metrics Shared Task achieving SOTA in that years competition.

See the [README.md] file at https://unbabel.github.io/COMET/html/models.html for more information.
'''

A	     =					'''
COMET score.

Args:

`sources` (list of str): Source sentences
`predictions` (list of str): candidate translations
`references` (list of str): reference translations
`cuda` (bool): If set to True, runs COMET using GPU
`show_progress` (bool): Shows progress
`model`: COMET model to be used. Will default to `wmt-large-da-estimator-1719` if None.

Returns:
    `samples`: List of dictionaries with `src`, `mt`, `ref` and `score`.
    `scores`: List of scores.

Examples:

    >>> comet_metric = datasets.load_metric(\'comet\')
    >>> # comet_metric = load_metric(\'comet\', \'wmt20-comet-da\')  # you can also choose which model to use
    >>> source = ["Dem Feuer konnte Einhalt geboten werden", "Schulen und Kindergärten wurden eröffnet."]
    >>> hypothesis = ["The fire could be stopped", "Schools and kindergartens were open"]
    >>> reference = ["They were able to control the fire.", "Schools and kindergartens opened"]
    >>> results = comet_metric.compute(predictions=hypothesis, references=reference, sources=source)
    >>> print([round(v, 2) for v in results["scores"]])
    [0.19, 0.92]
'''




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







					'''simple docstring'''




					def 	_lowerCamelCase						(  self       ):
									return datasets.MetricInfo(
									    description=_DESCRIPTION		,     citation=_CITATION		,     homepage='''https://unbabel.github.io/COMET/html/index.html'''		,     inputs_description=_KWARGS_DESCRIPTION		,     features=datasets.Features(
									        {
									            '''sources''': datasets.Value('''string'''		,     id='''sequence'''       ),
									            '''predictions''': datasets.Value('''string'''		,     id='''sequence'''       ),
									            '''references''': datasets.Value('''string'''		,     id='''sequence'''       ),
									        }       )		,     codebase_urls=['''https://github.com/Unbabel/COMET''']		,     reference_urls=[
									        '''https://github.com/Unbabel/COMET''',
									        '''https://www.aclweb.org/anthology/2020.emnlp-main.213/''',
									        '''http://www.statmt.org/wmt20/pdf/2020.wmt-1.101.pdf6''',
									    ]		,     )







					def 	_lowerCamelCase						(  self		,     _UpperCAmelCase       ):
									if self.config_name == "default":
													__a	:  List[str]         =					comet.load_from_checkpoint(comet.download_model('''wmt20-comet-da'''       )       )
									else:
													__a	:  List[str]         =					comet.load_from_checkpoint(comet.download_model(self.config_name       )       )







					def 	_lowerCamelCase						(  self		,     _UpperCAmelCase		,     _UpperCAmelCase		,     _UpperCAmelCase		,     _UpperCAmelCase=None		,     _UpperCAmelCase=False       ):
									if gpus is None:
													__a	:  str         =					1 if torch.cuda.is_available() else 0
									__a	:  Optional[Any]         =					{'''src''': sources, '''mt''': predictions, '''ref''': references}
									__a	:  Dict         =					[dict(zip(_UpperCAmelCase		,     _UpperCAmelCase       )       ) for t in zip(*data.values()       )]
									__a    ,  __a	:  int         =					self.scorer.predict(_UpperCAmelCase		,     gpus=_UpperCAmelCase		,     progress_bar=_UpperCAmelCase       )
									return {"mean_score": mean_score, "scores": scores}