Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
#
|
28 |
-
|
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)
|