Baghdad99 commited on
Commit
b122d68
·
1 Parent(s): 5c19cdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -24,11 +24,8 @@ def translate_speech(audio_file):
24
  audio = audio.set_channels(1)
25
  audio_data = np.array(audio.get_array_of_samples())
26
 
27
- # Use the speech recognition pipeline to transcribe the audio
28
- output = pipe(audio_data)
29
-
30
- # Convert the tensor to double
31
- audio_data = audio_data.double()
32
 
33
  # Use the speech recognition pipeline to transcribe the audio
34
  output = pipe(audio_data)
 
24
  audio = audio.set_channels(1)
25
  audio_data = np.array(audio.get_array_of_samples())
26
 
27
+ # Convert the numpy array to double
28
+ audio_data = audio_data.astype(np.float64)
 
 
 
29
 
30
  # Use the speech recognition pipeline to transcribe the audio
31
  output = pipe(audio_data)