Spaces:
Runtime error
Runtime error
Commit
·
87e8888
1
Parent(s):
01916a1
Moved code to the start
Browse files
app.py
CHANGED
@@ -8,6 +8,15 @@ import time
|
|
8 |
import numpy as np
|
9 |
import subprocess
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
def resample_to_16k(audio, orig_sr):
|
13 |
y_resampled = librosa.resample(y=audio, orig_sr=orig_sr, target_sr = 16000)
|
@@ -25,15 +34,9 @@ def transcribe(audio):
|
|
25 |
sf.write(temp_audio_path, y_resampled, 16000)
|
26 |
|
27 |
|
28 |
-
|
29 |
-
# wine_command = """sudo apt-get install wine"""
|
30 |
-
command2 = """chmod +777 ./whisper_blas_bin_v1_3_0/main.exe"""
|
31 |
-
# wine_c = subprocess.run(wine_command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
|
32 |
-
perm = subprocess.run(command2, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
|
33 |
-
# result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
34 |
command = rf"""wine './whisper_blas_bin_v1_3_0/main.exe' -m './whisper_blas_bin_v1_3_0/models/ggml-model-whisper-small.en.bin' -osrt -f '{temp_audio_path}' -nt"""
|
35 |
-
|
36 |
-
print("Access Installation: ",perm)
|
37 |
start_time = time.time()
|
38 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
39 |
end_time = time.time()
|
|
|
8 |
import numpy as np
|
9 |
import subprocess
|
10 |
|
11 |
+
# command = r"""wine './whisper_blas_bin_v1_3_0/main.exe' -h"""
|
12 |
+
# wine_command = """sudo apt-get install wine"""
|
13 |
+
command2 = """chmod +777 ./whisper_blas_bin_v1_3_0/main.exe"""
|
14 |
+
# wine_c = subprocess.run(wine_command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
|
15 |
+
perm = subprocess.run(command2, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
|
16 |
+
# result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
17 |
+
# print("Wine Installation: ",wine_c)
|
18 |
+
print("Access Installation: ",perm)
|
19 |
+
|
20 |
|
21 |
def resample_to_16k(audio, orig_sr):
|
22 |
y_resampled = librosa.resample(y=audio, orig_sr=orig_sr, target_sr = 16000)
|
|
|
34 |
sf.write(temp_audio_path, y_resampled, 16000)
|
35 |
|
36 |
|
37 |
+
|
|
|
|
|
|
|
|
|
|
|
38 |
command = rf"""wine './whisper_blas_bin_v1_3_0/main.exe' -m './whisper_blas_bin_v1_3_0/models/ggml-model-whisper-small.en.bin' -osrt -f '{temp_audio_path}' -nt"""
|
39 |
+
|
|
|
40 |
start_time = time.time()
|
41 |
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
42 |
end_time = time.time()
|