Update custom_interface_app.py
Browse files- custom_interface_app.py +3 -3
custom_interface_app.py
CHANGED
|
@@ -161,8 +161,8 @@ class ASR(Pretrained):
|
|
| 161 |
|
| 162 |
# Pass the segment through the ASR model
|
| 163 |
result = " ".join(self.encode_batch_w2v2(device, batch, rel_length)[0])
|
| 164 |
-
outputs.append(result)
|
| 165 |
-
|
| 166 |
else:
|
| 167 |
waveform = torch.tensor(waveform).to(device)
|
| 168 |
waveform = waveform.to(device)
|
|
@@ -170,7 +170,7 @@ class ASR(Pretrained):
|
|
| 170 |
batch = waveform.unsqueeze(0)
|
| 171 |
rel_length = torch.tensor([1.0]).to(device)
|
| 172 |
outputs = " ".join(self.encode_batch_w2v2(device, batch, rel_length)[0])
|
| 173 |
-
|
| 174 |
|
| 175 |
|
| 176 |
|
|
|
|
| 161 |
|
| 162 |
# Pass the segment through the ASR model
|
| 163 |
result = " ".join(self.encode_batch_w2v2(device, batch, rel_length)[0])
|
| 164 |
+
# outputs.append(result)
|
| 165 |
+
yield result
|
| 166 |
else:
|
| 167 |
waveform = torch.tensor(waveform).to(device)
|
| 168 |
waveform = waveform.to(device)
|
|
|
|
| 170 |
batch = waveform.unsqueeze(0)
|
| 171 |
rel_length = torch.tensor([1.0]).to(device)
|
| 172 |
outputs = " ".join(self.encode_batch_w2v2(device, batch, rel_length)[0])
|
| 173 |
+
yield [outputs]
|
| 174 |
|
| 175 |
|
| 176 |
|