File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,10 @@ def __call__(self, file: str) -> str:
5252 input_dict = self .processor (a ["input_values" ][0 ], return_tensors = "pt" , padding = True )
5353 logits = self .model (input_dict .input_values ).logits
5454 pred_ids = torch .argmax (logits , dim = - 1 )[0 ]
55-
56- txt = self .processor .batch_decode (logits .detach ().numpy ()).text [0 ]
55+ if self .model_name == "airesearch/wav2vec2-large-xlsr-53-th" :
56+ txt = self .processor .decode (pred_ids ).replace (' ' ,'' )
57+ else :
58+ txt = self .processor .batch_decode (logits .detach ().numpy ()).text [0 ]
5759 return txt
5860
5961_model_name = "airesearch/wav2vec2-large-xlsr-53-th"
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def read(*paths):
2727
2828setup (
2929 name = 'pythaiasr' ,
30- version = '1.1.0 ' ,
30+ version = '1.1.1 ' ,
3131 packages = ['pythaiasr' ],
3232 url = 'https://github.com/pythainlp/pythaiasr' ,
3333 license = 'Apache Software License 2.0' ,
You can’t perform that action at this time.
0 commit comments