EuroEval 15.3.0__py3-none-any.whl → 15.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of EuroEval might be problematic. Click here for more details.

euroeval/benchmarker.py CHANGED
@@ -18,7 +18,7 @@ from .data_loading import load_data
18
18
  from .data_models import BenchmarkConfigParams, BenchmarkResult
19
19
  from .dataset_configs import get_all_dataset_configs
20
20
  from .enums import Device, ModelType
21
- from .exceptions import InvalidBenchmark, InvalidModel
21
+ from .exceptions import HuggingFaceHubDown, InvalidBenchmark, InvalidModel
22
22
  from .finetuning import finetune
23
23
  from .generation import generate
24
24
  from .model_config import get_model_config
@@ -769,23 +769,21 @@ class Benchmarker:
769
769
  logger.debug(f"Results:\n{results}")
770
770
  return record
771
771
 
772
+ except HuggingFaceHubDown:
773
+ wait_time = 30
774
+ logger.debug(
775
+ f"The Hugging Face Hub seems to be down. Retrying in {wait_time} "
776
+ "seconds."
777
+ )
778
+ sleep(wait_time)
779
+ continue
780
+
772
781
  except (InvalidBenchmark, InvalidModel) as e:
773
782
  # If the model ID is not valid then raise an error
774
783
  model_err_msg = "does not exist on the Hugging Face Hub"
775
784
  if benchmark_config.raise_errors and model_err_msg in str(e):
776
785
  raise e
777
786
 
778
- # Otherwise, if the error is due to Hugging Face Hub being down, then
779
- # wait a bit and try again
780
- elif "The Hugging Face Hub seems to be down." in str(e):
781
- wait_time = 30
782
- logger.debug(
783
- "The Hugging Face Hub seems to be down. Retrying in "
784
- f"{wait_time} seconds."
785
- )
786
- sleep(wait_time)
787
- continue
788
-
789
787
  # Otherwise, if the error is due to the MPS fallback not being enabled,
790
788
  # then raise an error asking the user to enable it
791
789
  elif "PYTORCH_ENABLE_MPS_FALLBACK" in str(e):
euroeval/data_loading.py CHANGED
@@ -10,7 +10,7 @@ from huggingface_hub.errors import HfHubHTTPError
10
10
  from numpy.random import Generator
11
11
 
12
12
  from .data_models import BenchmarkConfig, DatasetConfig
13
- from .exceptions import InvalidBenchmark
13
+ from .exceptions import HuggingFaceHubDown, InvalidBenchmark
14
14
  from .utils import unscramble
15
15
 
16
16
  logger = logging.getLogger("euroeval")
@@ -31,6 +31,12 @@ def load_data(
31
31
 
32
32
  Returns:
33
33
  A list of bootstrapped datasets, one for each iteration.
34
+
35
+ Raises:
36
+ InvalidBenchmark:
37
+ If the dataset cannot be loaded.
38
+ HuggingFaceHubDown:
39
+ If the Hugging Face Hub is down.
34
40
  """
35
41
  num_attempts = 5
36
42
  for _ in range(num_attempts):
@@ -41,14 +47,14 @@ def load_data(
41
47
  token=unscramble("HjccJFhIozVymqXDVqTUTXKvYhZMTbfIjMxG_"),
42
48
  )
43
49
  break
44
- except (FileNotFoundError, DatasetsError):
50
+ except (FileNotFoundError, DatasetsError, ConnectionError):
45
51
  logger.warning(
46
52
  f"Failed to load dataset {dataset_config.huggingface_id!r}. Retrying..."
47
53
  )
48
54
  time.sleep(1)
49
55
  continue
50
56
  except HfHubHTTPError:
51
- raise InvalidBenchmark("The Hugging Face Hub seems to be down.")
57
+ raise HuggingFaceHubDown()
52
58
  else:
53
59
  raise InvalidBenchmark(
54
60
  f"Failed to load dataset {dataset_config.huggingface_id!r} after "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: EuroEval
3
- Version: 15.3.0
3
+ Version: 15.3.1
4
4
  Summary: The robust European language model benchmark.
5
5
  Project-URL: Repository, https://github.com/EuroEval/EuroEval
6
6
  Project-URL: Issues, https://github.com/EuroEval/EuroEval/issues
@@ -1,10 +1,10 @@
1
1
  euroeval/__init__.py,sha256=3od9_ucHlILSbe4WCR8k5PbeorvmUr-VjOKXJ01I0fA,2165
2
2
  euroeval/benchmark_config_factory.py,sha256=pi4Lu--ySKZRd9ItG6VKS6BPLis64vL-7UE99VSXq5Y,12534
3
- euroeval/benchmarker.py,sha256=EjORG5haUio9LgfGH7ruWEFutvJN0QGasoknFH_yGHs,46705
3
+ euroeval/benchmarker.py,sha256=__DdnOvI9CNpgqPT1hsTl0GZFTyQ6KRfiQowCuh36sc,46534
4
4
  euroeval/callbacks.py,sha256=bThUUxOgkMuESUQ5rrFRoSumKV8vNw53CslIZTpkt54,2438
5
5
  euroeval/cli.py,sha256=EMB6g6kRvxIqlfYLSoMzwLAtEd-fqXipo4A_HTkhjkA,8575
6
6
  euroeval/constants.py,sha256=qFrm3cRT6UlnTXfHUmxqZsr0SBsGskjV1qrUlnAW-aw,1473
7
- euroeval/data_loading.py,sha256=IHd1H4OCAtOyiro7YnJsGbbT7PTwiMUB02gh1g6Nlhg,3116
7
+ euroeval/data_loading.py,sha256=RoatBJMpGurP_y5O3KrEvly8Z_yYEapQnnMZ_tWWrlc,3272
8
8
  euroeval/data_models.py,sha256=4ZY9x2pINlRywTzYxxtrYG7qXMNdod5I9XBOlTJYT8E,14495
9
9
  euroeval/dataset_configs.py,sha256=Cj3McxA0JTC7RKzXofzpJfmIhoXAfF756f_1SZUaPlw,84391
10
10
  euroeval/enums.py,sha256=L9LcNeruuhHvze9vKRogXY9vonRzoBqDzWSP6hxKQ7A,3195
@@ -33,8 +33,8 @@ euroeval/task_utils/question_answering.py,sha256=G01s11JcQ7UxeBcKaCO3k0DL4zkVmEb
33
33
  euroeval/task_utils/sequence_classification.py,sha256=FrkvFzxFSnZoXThgpQqvJCIy3_YemyqZFQ1L-YdMMiw,8527
34
34
  euroeval/task_utils/text_to_text.py,sha256=DdLruAO4D9Iv5aAXx40la3X3pKbKLUn0-ViBJkMKsTI,5698
35
35
  euroeval/task_utils/token_classification.py,sha256=yT1YvZzmqNaVSRZ67BvyURhlkgTm3ltWPft4HxodZAE,17983
36
- euroeval-15.3.0.dist-info/METADATA,sha256=Mlz6DcLg2H3aWoCXngQZNdFMrJmUFpAdD0FD0wsBKHw,10263
37
- euroeval-15.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
- euroeval-15.3.0.dist-info/entry_points.txt,sha256=tKQRxN0HX2mGtbZbZQdCRFUDZIecA_z4mZduueor3Ug,135
39
- euroeval-15.3.0.dist-info/licenses/LICENSE,sha256=oZp5fpOSQ7w-vFui8QNwrBIosrO7cnpArItdbvn52Ao,1082
40
- euroeval-15.3.0.dist-info/RECORD,,
36
+ euroeval-15.3.1.dist-info/METADATA,sha256=elF7s_zt2tj9Hl1EMMDfNoMtskYK5Xh9i-N36vvzfQs,10263
37
+ euroeval-15.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
+ euroeval-15.3.1.dist-info/entry_points.txt,sha256=tKQRxN0HX2mGtbZbZQdCRFUDZIecA_z4mZduueor3Ug,135
39
+ euroeval-15.3.1.dist-info/licenses/LICENSE,sha256=oZp5fpOSQ7w-vFui8QNwrBIosrO7cnpArItdbvn52Ao,1082
40
+ euroeval-15.3.1.dist-info/RECORD,,