Skip to content

Commit dec9614

Browse files
sampathwebmattdangerw
authored andcommitted
Change import of to directly import (#691)
1 parent 729815b commit dec9614

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

keras_nlp/metrics/rouge_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
from keras_nlp.utils.tf_utils import tensor_to_string_list
2424

2525
try:
26-
import rouge_score
2726
from rouge_score import rouge_scorer
2827
except ImportError:
29-
rouge_score = None
28+
rouge_scorer = None
3029

3130

3231
class RougeBase(keras.metrics.Metric):
@@ -63,7 +62,7 @@ def __init__(
6362
):
6463
super().__init__(name=name, dtype=dtype, **kwargs)
6564

66-
if rouge_score is None:
65+
if rouge_scorer is None:
6766
raise ImportError(
6867
f"{self.__class__.__name__} requires the `rouge_score` "
6968
"package. Please install it with `pip install rouge-score`."

0 commit comments

Comments
 (0)