Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,8 +26,7 @@ def transcribe_audio(audio_data):
|
|
26 |
input_features = preprocess_audio(audio_data)
|
27 |
input_values = torch.tensor(input_features["input_values"]).unsqueeze(0) # Add batch dimension
|
28 |
# Ensure the input tensor has the correct shape
|
29 |
-
input_values = input_values.view(1,
|
30 |
-
input_values = input_values.permute(0, 2, 1)
|
31 |
predicted_ids = model.generate(input_values)
|
32 |
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
|
33 |
return transcription[0]
|
|
|
26 |
input_features = preprocess_audio(audio_data)
|
27 |
input_values = torch.tensor(input_features["input_values"]).unsqueeze(0) # Add batch dimension
|
28 |
# Ensure the input tensor has the correct shape
|
29 |
+
input_values = input_values.view(1, 1, -1)
|
|
|
30 |
predicted_ids = model.generate(input_values)
|
31 |
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
|
32 |
return transcription[0]
|