Migrate metrics used in flax examples to Evaluate (#18348)

Currently, tensorflow examples use the `load_metric` function from
Datasets library, commit migrates function call to `load` function
from Evaluate library.
This commit is contained in:
Vijay S Kalmath
2022-07-28 15:06:23 -04:00
committed by GitHub
parent a2586795e5
commit da503ea02f
6 changed files with 18 additions and 12 deletions

View File

@@ -29,9 +29,10 @@ from typing import Any, Callable, Dict, Optional, Tuple
import datasets
import numpy as np
from datasets import ClassLabel, load_dataset, load_metric
from datasets import ClassLabel, load_dataset
from tqdm import tqdm
import evaluate
import jax
import jax.numpy as jnp
import optax
@@ -646,7 +647,7 @@ def main():
p_eval_step = jax.pmap(eval_step, axis_name="batch")
metric = load_metric("seqeval")
metric = evaluate.load("seqeval")
def get_labels(y_pred, y_true):
# Transform predictions and references tensos to numpy arrays