Upload eval_utils.py with huggingface_hub
Browse files- eval_utils.py +2 -9
eval_utils.py
CHANGED
@@ -31,13 +31,13 @@ def _(
|
|
31 |
metric = verbosed_fetch_artifact(metric_name)
|
32 |
metric_step = as_remote_metric(metric)
|
33 |
else:
|
34 |
-
# The SequentialOperator below will handle the load of the metric
|
35 |
metric_step = metric_name
|
36 |
metrics_operator = SequentialOperator(steps=[metric_step])
|
37 |
|
38 |
if not compute_conf_intervals:
|
39 |
first_step = metrics_operator.steps[0]
|
40 |
-
|
41 |
|
42 |
instances = list(metrics_operator(multi_stream)["test"])
|
43 |
for entry, instance in zip(dataset, instances):
|
@@ -46,13 +46,6 @@ def _(
|
|
46 |
if len(instances) > 0:
|
47 |
global_scores[metric_name] = instances[0]["score"].get("global", {})
|
48 |
|
49 |
-
# To overcome issue #325: the modified metric artifact is cached and
|
50 |
-
# a sequential retrieval of an artifact with the same name will
|
51 |
-
# retrieve the metric with the previous modification.
|
52 |
-
# This reverts the confidence interval change and restores the initial metric.
|
53 |
-
if not compute_conf_intervals:
|
54 |
-
first_step.set_n_resamples(n_resamples)
|
55 |
-
|
56 |
return dataset, global_scores
|
57 |
|
58 |
|
|
|
31 |
metric = verbosed_fetch_artifact(metric_name)
|
32 |
metric_step = as_remote_metric(metric)
|
33 |
else:
|
34 |
+
# The SequentialOperator below will handle the load of the metric from its name
|
35 |
metric_step = metric_name
|
36 |
metrics_operator = SequentialOperator(steps=[metric_step])
|
37 |
|
38 |
if not compute_conf_intervals:
|
39 |
first_step = metrics_operator.steps[0]
|
40 |
+
first_step.disable_confidence_interval_calculation()
|
41 |
|
42 |
instances = list(metrics_operator(multi_stream)["test"])
|
43 |
for entry, instance in zip(dataset, instances):
|
|
|
46 |
if len(instances) > 0:
|
47 |
global_scores[metric_name] = instances[0]["score"].get("global", {})
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
return dataset, global_scores
|
50 |
|
51 |
|