File tree 2 files changed +5
-3
lines changed 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:
52
52
input_dict = self .processor (a ["input_values" ][0 ], return_tensors = "pt" , padding = True )
53
53
logits = self .model (input_dict .input_values ).logits
54
54
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 ]
57
59
return txt
58
60
59
61
_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):
27
27
28
28
setup (
29
29
name = 'pythaiasr' ,
30
- version = '1.1.0 ' ,
30
+ version = '1.1.1 ' ,
31
31
packages = ['pythaiasr' ],
32
32
url = 'https://github.com/pythainlp/pythaiasr' ,
33
33
license = 'Apache Software License 2.0' ,
You can’t perform that action at this time.
0 commit comments