Spaces:
Runtime error
Runtime error
Shrirang20
commited on
Commit
•
a187ee0
1
Parent(s):
088641a
Update app.py
Browse files
app.py
CHANGED
@@ -22,26 +22,32 @@ import os
|
|
22 |
import subprocess
|
23 |
import sys
|
24 |
|
|
|
|
|
|
|
25 |
print("CURRENT WORKING DIRECTORY:",os.getcwd())
|
26 |
setup_flag = 'setup_complete.flag'
|
|
|
27 |
if not os.path.exists(setup_flag):
|
28 |
os.system('wget https://indic-asr-public.objectstore.e2enetworks.net/ai4b_nemo.zip')
|
29 |
os.system('unzip -q ai4b_nemo.zip')
|
|
|
30 |
os.chdir('NeMo')
|
31 |
-
|
32 |
os.system('bash reinstall.sh')
|
33 |
os.chdir('..')
|
34 |
|
35 |
os.system('git clone -q https://github.com/VarunGumma/IndicTransTokenizer')
|
36 |
os.chdir('IndicTransTokenizer')
|
37 |
-
|
38 |
os.chdir('..')
|
39 |
|
40 |
-
subprocess.run(['apt-get', 'install', '-y', 'libsndfile1-dev', 'ffmpeg'])
|
|
|
41 |
os.system('git clone https://github.com/gokulkarthik/TTS')
|
42 |
os.chdir('TTS')
|
43 |
-
|
44 |
-
|
45 |
os.chdir('..')
|
46 |
|
47 |
with open(setup_flag, 'w') as f:
|
|
|
22 |
import subprocess
|
23 |
import sys
|
24 |
|
25 |
+
def install_with_subprocess(args):
|
26 |
+
subprocess.run(args, check=True)
|
27 |
+
|
28 |
print("CURRENT WORKING DIRECTORY:",os.getcwd())
|
29 |
setup_flag = 'setup_complete.flag'
|
30 |
+
|
31 |
if not os.path.exists(setup_flag):
|
32 |
os.system('wget https://indic-asr-public.objectstore.e2enetworks.net/ai4b_nemo.zip')
|
33 |
os.system('unzip -q ai4b_nemo.zip')
|
34 |
+
|
35 |
os.chdir('NeMo')
|
36 |
+
install_with_subprocess([sys.executable, '-m', 'pip', 'install', '-e', '.'])
|
37 |
os.system('bash reinstall.sh')
|
38 |
os.chdir('..')
|
39 |
|
40 |
os.system('git clone -q https://github.com/VarunGumma/IndicTransTokenizer')
|
41 |
os.chdir('IndicTransTokenizer')
|
42 |
+
install_with_subprocess([sys.executable,'-m','pip','install','-q','--editable','./'])
|
43 |
os.chdir('..')
|
44 |
|
45 |
+
subprocess.run(['apt-get', 'install', '-y', 'libsndfile1-dev', 'ffmpeg'],check=True)
|
46 |
+
|
47 |
os.system('git clone https://github.com/gokulkarthik/TTS')
|
48 |
os.chdir('TTS')
|
49 |
+
install_with_subprocess(['pip3', 'install', '-e', '.[all]'])
|
50 |
+
install_with_subprocess(['pip3', 'install', '-r', 'requirements.txt'])
|
51 |
os.chdir('..')
|
52 |
|
53 |
with open(setup_flag, 'w') as f:
|