Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import snapshot_download
|
2 |
+
|
3 |
+
def load_tokenizer_from_hub(repo_name: str = "Kyudan/TeXBLEU-Tokenizer") -> Tokenizer:
|
4 |
+
# Hugging Face Hub์์ ํ ํฌ๋์ด์ ๋ค์ด๋ก๋
|
5 |
+
snapshot_dir = snapshot_download(repo_id=repo_name)
|
6 |
+
|
7 |
+
# ๋ค์ด๋ก๋ํ ํ ํฌ๋์ด์ ๋ถ๋ฌ์ค๊ธฐ
|
8 |
+
tokenizer = Tokenizer.from_file(f"{snapshot_dir}/tokenizer.json")
|
9 |
+
return tokenizer
|