We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa22d7d commit 74e27b1Copy full SHA for 74e27b1
pythaiasr/__init__.py
@@ -65,10 +65,12 @@ def __call__(self, file: str) -> str:
65
input_dict = self.processor(a["input_values"][0], return_tensors="pt", padding=True)
66
logits = self.model(input_dict.input_values).logits
67
pred_ids = torch.argmax(logits, dim=-1)[0]
68
- if self.model_name == "airesearch/wav2vec2-large-xlsr-53-th" or self.lm:
+ if self.model_name == "airesearch/wav2vec2-large-xlsr-53-th":
69
txt = self.processor.decode(pred_ids)
70
- else:
+ elif self.lm:
71
txt = self.processor.batch_decode(logits.detach().numpy()).text[0]
72
+ else:
73
+ txt = self.processor.decode(pred_ids)
74
return txt
75
76
_model_name = "airesearch/wav2vec2-large-xlsr-53-th"
0 commit comments