zhifu gao
2024-03-04 d2c1204d91d7c98be7998e3966bd82e22750293b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
try:
    from transformers import AutoTokenizer
except:
    print("If you want to use hugging, please `pip install -U transformers`")
 
from funasr.register import tables
 
@tables.register("tokenizer_classes", "HuggingfaceTokenizer")
def HuggingfaceTokenizer(init_param_path, **kwargs):
 
    tokenizer = AutoTokenizer.from_pretrained(init_param_path)
    
    return tokenizer