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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user