diff --git a/pythaiasr/__init__.py b/pythaiasr/__init__.py index 9bac88c..3f82993 100644 --- a/pythaiasr/__init__.py +++ b/pythaiasr/__init__.py @@ -52,8 +52,10 @@ def __call__(self, file: str) -> str: input_dict = self.processor(a["input_values"][0], return_tensors="pt", padding=True) logits = self.model(input_dict.input_values).logits pred_ids = torch.argmax(logits, dim=-1)[0] - - txt = self.processor.batch_decode(logits.detach().numpy()).text[0] + if self.model_name == "airesearch/wav2vec2-large-xlsr-53-th": + txt = self.processor.decode(pred_ids).replace(' ','') + else: + txt = self.processor.batch_decode(logits.detach().numpy()).text[0] return txt _model_name = "airesearch/wav2vec2-large-xlsr-53-th" diff --git a/setup.py b/setup.py index 50e533e..f785cf8 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def read(*paths): setup( name='pythaiasr', - version='1.1.0', + version='1.1.1', packages=['pythaiasr'], url='https://github.com/pythainlp/pythaiasr', license='Apache Software License 2.0',