Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,42 @@
|
|
1 |
import os
|
2 |
import subprocess
|
|
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
import gradio as gr
|
8 |
import torch
|
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
+
import sys
|
4 |
|
5 |
+
# Function to install a package if not already installed
|
6 |
+
def install_package(package):
|
7 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
8 |
+
|
9 |
+
# List of required packages
|
10 |
+
required_packages = [
|
11 |
+
"transformers==4.10.3",
|
12 |
+
"datasets",
|
13 |
+
"huggingface-hub>=0.19",
|
14 |
+
"hf-transfer>=0.1.4",
|
15 |
+
"protobuf<4",
|
16 |
+
"click<8.1",
|
17 |
+
"pydantic~=1.0",
|
18 |
+
"librosa==0.8.1",
|
19 |
+
"torch==2.2.0",
|
20 |
+
"torchaudio==2.2.0",
|
21 |
+
"scipy",
|
22 |
+
"Cython==0.29.21",
|
23 |
+
"phonemizer==2.2.1",
|
24 |
+
"scikit-learn",
|
25 |
+
"matplotlib",
|
26 |
+
"gradio==3.1.4",
|
27 |
+
"sentencepiece",
|
28 |
+
"resampy>=0.2.2",
|
29 |
+
"numba>=0.43.0",
|
30 |
+
"soundfile>=0.10.2",
|
31 |
+
"pooch>=1.0",
|
32 |
+
"decorator>=3.0.0",
|
33 |
+
"joblib>=0.14",
|
34 |
+
"audioread>=2.0.0"
|
35 |
+
]
|
36 |
+
|
37 |
+
# Install all required packages
|
38 |
+
for package in required_packages:
|
39 |
+
install_package(package)
|
40 |
|
41 |
import gradio as gr
|
42 |
import torch
|