Spaces:
Runtime error
Runtime error
allandclive
commited on
Commit
·
2df5a70
1
Parent(s):
22a0e2a
Update stitched_model.py
Browse files- stitched_model.py +1 -1
stitched_model.py
CHANGED
@@ -16,7 +16,7 @@ class CombinedModel(nn.Module):
|
|
16 |
# Use stt_model to transcribe the audio to text
|
17 |
device = self.device
|
18 |
audio = torch.tensor(batch["audio"][0]).to(self.device)
|
19 |
-
input_features = self.stt_processor(audio,sampling_rate=16000, return_tensors="pt",max_length=
|
20 |
stt_output = self.stt_model(input_features.input_values.to(device), attention_mask= input_features.attention_mask.to(device) )
|
21 |
transcription = self.stt_processor.decode(torch.squeeze(stt_output.logits.argmax(axis=-1)).to(device))
|
22 |
input_nmt_tokens = self.nmt_tokenizer(transcription, return_tensors="pt", padding=True, truncation=True)
|
|
|
16 |
# Use stt_model to transcribe the audio to text
|
17 |
device = self.device
|
18 |
audio = torch.tensor(batch["audio"][0]).to(self.device)
|
19 |
+
input_features = self.stt_processor(audio,sampling_rate=16000, return_tensors="pt",max_length=220000, padding=True, truncation=True)
|
20 |
stt_output = self.stt_model(input_features.input_values.to(device), attention_mask= input_features.attention_mask.to(device) )
|
21 |
transcription = self.stt_processor.decode(torch.squeeze(stt_output.logits.argmax(axis=-1)).to(device))
|
22 |
input_nmt_tokens = self.nmt_tokenizer(transcription, return_tensors="pt", padding=True, truncation=True)
|