Download funasr/tokenizer/hf_tokenizer.py from ml-resources/FunASR-bmodel: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/ml-resources/FunASR-bmodel/resolve/main/funasr/tokenizer/hf_tokenizer.py
- Command line
-
hf download hf://ml-resources/FunASR-bmodel/funasr/tokenizer/hf_tokenizer.py
-
curl -L -o hf_tokenizer.py https://huggingface.co/ml-resources/FunASR-bmodel/resolve/main/funasr/tokenizer/hf_tokenizer.py
402 Bytes
| from funasr.register import tables | |
| def HuggingfaceTokenizer(init_param_path, **kwargs): | |
| try: | |
| from transformers import AutoTokenizer | |
| except: | |
| # print("If you want to use hugging, please `pip install -U transformers`") | |
| pass | |
| tokenizer = AutoTokenizer.from_pretrained(init_param_path) | |
| return tokenizer | |