Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,11 @@ def transcribe_audio(audio_bytes):
|
|
25 |
# Preprocess audio
|
26 |
input_features = preprocess_audio(audio_bytes)
|
27 |
|
|
|
|
|
|
|
28 |
# Generate transcription
|
29 |
-
generated_ids = model.generate(input_features)
|
30 |
translation = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
31 |
|
32 |
return translation
|
|
|
25 |
# Preprocess audio
|
26 |
input_features = preprocess_audio(audio_bytes)
|
27 |
|
28 |
+
# Tokenize audio
|
29 |
+
inputs = processor(input_features, return_tensors="pt", padding=True)
|
30 |
+
|
31 |
# Generate transcription
|
32 |
+
generated_ids = model.generate(inputs.input_features)
|
33 |
translation = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
34 |
|
35 |
return translation
|