pratikshahp commited on
Commit
6daa843
·
verified ·
1 Parent(s): 51c49e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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