We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e960c9 commit 2434979Copy full SHA for 2434979
pythainlp/corpus/core.py
@@ -647,11 +647,13 @@ def get_hf_hub(repo_id:str, filename: str=None) -> str:
647
return False
648
try:
649
from huggingface_hub import hf_hub_download, snapshot_download
650
- except:
+ except ModuleNotFoundError:
651
raise ModuleNotFoundError("""
652
huggingface-hub isn't found!
653
Please installing the package via 'pip install huggingface-hub'.
654
""")
655
+ except Exception as e:
656
+ raise Exception(f"An unexpected error occurred: {e}")
657
hf_root = get_full_data_path("hf_models")
658
name_dir = make_safe_directory_name(repo_id)
659
root_project = os.path.join(hf_root, name_dir)
0 commit comments