Skip to content

Commit 2434979

Browse files
committed
Update core.py
1 parent 0e960c9 commit 2434979

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pythainlp/corpus/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,13 @@ def get_hf_hub(repo_id:str, filename: str=None) -> str:
647647
return False
648648
try:
649649
from huggingface_hub import hf_hub_download, snapshot_download
650-
except:
650+
except ModuleNotFoundError:
651651
raise ModuleNotFoundError("""
652652
huggingface-hub isn't found!
653653
Please installing the package via 'pip install huggingface-hub'.
654654
""")
655+
except Exception as e:
656+
raise Exception(f"An unexpected error occurred: {e}")
655657
hf_root = get_full_data_path("hf_models")
656658
name_dir = make_safe_directory_name(repo_id)
657659
root_project = os.path.join(hf_root, name_dir)

0 commit comments

Comments
 (0)