Skip to content

Commit 999e2a6

Browse files
committed
Update core.py
1 parent f7df55d commit 999e2a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pythainlp/corpus/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@ def remove(name: str) -> bool:
585585
# FileNotFoundError: [Errno 2] No such file or directory:
586586
# '/usr/local/lib/python3.6/dist-packages/pythainlp/corpus/ttc'
587587
"""
588+
if _CHECK_MODE == "1":
589+
print("PyThaiNLP is read-only mode. It can't download.")
590+
return False
588591
with open(corpus_db_path(), "r", encoding="utf-8-sig") as f:
589592
db = json.load(f)
590593
data = [
@@ -642,9 +645,6 @@ def get_hf_hub(repo_id:str, filename: str=None) -> str:
642645
:return: path
643646
:rtype: str
644647
"""
645-
if _CHECK_MODE == "1":
646-
print("PyThaiNLP is read-only mode. It can't download.")
647-
return False
648648
try:
649649
from huggingface_hub import hf_hub_download, snapshot_download
650650
except ModuleNotFoundError:

0 commit comments

Comments
 (0)