Migrate metric to Evaluate library for tensorflow examples (#18327)

* Migrate metric to Evaluate library in tf examples

Currently tensorflow examples use `load_metric` function from Datasets
library , commit migrates function call to `load` function to
Evaluate library.

Fix for #18306

* Migrate metric to Evaluate library in tf examples

Currently tensorflow examples use `load_metric` function from Datasets
library , commit migrates function call to `load` function to
Evaluate library.

Fix for #18306

* Migrate `metric` to Evaluate for all tf examples

Currently tensorflow examples use `load_metric` function from Datasets
library , commit migrates function call to `load` function to
Evaluate library.
This commit is contained in:
Vijay S Kalmath
2022-07-28 14:24:27 -04:00
committed by GitHub
parent 7b0908769b
commit a2586795e5
10 changed files with 27 additions and 11 deletions

View File

@@ -29,9 +29,10 @@ import datasets
import nltk # Here to have a nice missing dependency error message early on
import numpy as np
import tensorflow as tf
from datasets import load_dataset, load_metric
from datasets import load_dataset
from tqdm import tqdm
import evaluate
import transformers
from filelock import FileLock
from transformers import (
@@ -634,7 +635,7 @@ def main():
# endregion
# region Metric
metric = load_metric("rouge")
metric = evaluate.load("rouge")
# endregion
# region Training