Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Loose Dependency Imports #199

Merged
merged 2 commits into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions API_DESIGN_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,20 @@ and add installation instructions for the specific symbol:
try:
import rouge_score
except ImportError:
pass
rouge_score = None

class RougeL(keras.metrics.Metric):
class Rouge(keras.metrics.Metric):
def __init__(self):
if rouge_score is None:
raise ImportError(
'RougeL metrics requires the rouge_score package. '
'`pip install rouge-score`.')
"ROUGE metric requires the `rouge_score` package."
"Please install it with `pip install rouge_score`."
)
```

Additionally, to ensure that unit tests don't fail, please add the corresponding
library to the `extras_require["tests"]` list in `setup.py`.

## Keep computation inside TensorFlow graph

Our layers, metrics, and tokenizers should be fast and efficient, which means
Expand Down