mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-24 06:48:58 +06:00
fix nltk lookup (#10585)
This commit is contained in:
parent
9dd054fba2
commit
e6ce636e02
@ -52,7 +52,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
nltk.data.find("tokenizers/punkt")
|
nltk.data.find("tokenizers/punkt")
|
||||||
except LookupError:
|
except (LookupError, OSError):
|
||||||
if is_offline_mode():
|
if is_offline_mode():
|
||||||
raise LookupError(
|
raise LookupError(
|
||||||
"Offline mode: run this script without TRANSFORMERS_OFFLINE first to download nltk data files"
|
"Offline mode: run this script without TRANSFORMERS_OFFLINE first to download nltk data files"
|
||||||
|
Loading…
Reference in New Issue
Block a user