Update app.py
Browse files
app.py
CHANGED
@@ -12,20 +12,22 @@ import subprocess
|
|
12 |
from pydub import AudioSegment
|
13 |
from huggingface_hub import snapshot_download
|
14 |
|
|
|
|
|
|
|
|
|
15 |
def install_fairseq():
|
16 |
try:
|
17 |
# Run pip install command to install fairseq
|
18 |
subprocess.check_call(["pip", "install", "fairseq"])
|
19 |
subprocess.check_call(["pip", "install", "sentencepiece"])
|
20 |
-
subprocess.check_call(["pip", "install", "soundfile"])
|
21 |
-
subprocess.check_call(["pip", "install", "gTTS"])
|
22 |
-
subprocess.check_call(["pip", "install", "gtts"])
|
23 |
return "fairseq successfully installed!"
|
24 |
except subprocess.CalledProcessError as e:
|
25 |
return f"An error occurred while installing fairseq: {str(e)}"
|
26 |
|
27 |
|
28 |
-
|
29 |
|
30 |
def convert_audio_to_16k_wav(audio_input):
|
31 |
sound = AudioSegment.from_file(audio_input)
|
|
|
12 |
from pydub import AudioSegment
|
13 |
from huggingface_hub import snapshot_download
|
14 |
|
15 |
+
subprocess.check_call(["pip", "install", "gtts"])
|
16 |
+
subprocess.check_call(["pip", "install", "gTTS"])
|
17 |
+
from gtts import gTTS
|
18 |
+
|
19 |
def install_fairseq():
|
20 |
try:
|
21 |
# Run pip install command to install fairseq
|
22 |
subprocess.check_call(["pip", "install", "fairseq"])
|
23 |
subprocess.check_call(["pip", "install", "sentencepiece"])
|
24 |
+
subprocess.check_call(["pip", "install", "soundfile"])
|
|
|
|
|
25 |
return "fairseq successfully installed!"
|
26 |
except subprocess.CalledProcessError as e:
|
27 |
return f"An error occurred while installing fairseq: {str(e)}"
|
28 |
|
29 |
|
30 |
+
|
31 |
|
32 |
def convert_audio_to_16k_wav(audio_input):
|
33 |
sound = AudioSegment.from_file(audio_input)
|