fix nltk lookup (#10585)

This commit is contained in:
Stas Bekman 2021-03-07 22:09:58 -08:00 committed by GitHub
parent 9dd054fba2
commit e6ce636e02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ logger = logging.getLogger(__name__)
try:
nltk.data.find("tokenizers/punkt")
except LookupError:
except (LookupError, OSError):
if is_offline_mode():
raise LookupError(
"Offline mode: run this script without TRANSFORMERS_OFFLINE first to download nltk data files"