Kyudan commited on
Commit
6c0177c
โ€ข
1 Parent(s): c9f7948

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -0
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