Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,19 @@ from pprint import pprint
|
|
8 |
import os
|
9 |
import gradio as gr
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Constants
|
12 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
MODEL = SpeechRecognitionModel("jonatasgrosman/wav2vec2-large-xlsr-53-english", device = DEVICE)
|
|
|
8 |
import os
|
9 |
import gradio as gr
|
10 |
|
11 |
+
|
12 |
+
|
13 |
+
import subprocess # process in the os
|
14 |
+
from subprocess import STDOUT, check_call #os process manipulation
|
15 |
+
|
16 |
+
|
17 |
+
"""install libsndfile on the linux machine"""
|
18 |
+
proc = subprocess.Popen('apt-get install libsndfile1', shell=True, stdin=None, stdout=open(os.devnull,"wb"), stderr=STDOUT, executable="/bin/bash")
|
19 |
+
proc.wait()
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
# Constants
|
25 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
26 |
MODEL = SpeechRecognitionModel("jonatasgrosman/wav2vec2-large-xlsr-53-english", device = DEVICE)
|