Skip to content

Commit

Permalink
fix load jieba once
Browse files Browse the repository at this point in the history
  • Loading branch information
Mddct committed Nov 1, 2024
1 parent 5bd0663 commit ab2f6f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wenet/cli/punc_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def __init__(self, model_dir: str) -> None:

self.model = torch.jit.load(model_path)
self.tokenizer = CharTokenizer(units_path)
# self.model = torch.jit.load(model_path)
self.device = torch.device("cpu")
self.use_jieba = False

self.punc_table = ['<unk>', '', ',', '。', '?', '、']

def split_words(self, text: str):
if not self.use_jieba:
self.use_jieba = True
import logging

import jieba
Expand Down

0 comments on commit ab2f6f8

Please sign in to comment.