osanseviero
commited on
Commit
·
5058959
1
Parent(s):
5913155
Update pipeline.py
Browse files- pipeline.py +1 -1
pipeline.py
CHANGED
@@ -39,7 +39,7 @@ class PreTrainedPipeline():
|
|
39 |
A :obj:`dict`:. The object return should be liked {"text": "XXX"} containing
|
40 |
the detected text from the input audio.
|
41 |
"""
|
42 |
-
input_values = self.processor(
|
43 |
logits = self.model(input_values).logits.cpu().detach().numpy()[0]
|
44 |
return {
|
45 |
"text": self.decoder.decode(logits)
|
|
|
39 |
A :obj:`dict`:. The object return should be liked {"text": "XXX"} containing
|
40 |
the detected text from the input audio.
|
41 |
"""
|
42 |
+
input_values = self.processor(inputs, return_tensors="pt", sampling_rate=self.sampling_rate).input_values # Batch size 1
|
43 |
logits = self.model(input_values).logits.cpu().detach().numpy()[0]
|
44 |
return {
|
45 |
"text": self.decoder.decode(logits)
|