Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ from kokoro import KPipeline
|
|
3 |
import soundfile as sf
|
4 |
import io
|
5 |
import os
|
6 |
-
import subprocess
|
7 |
|
8 |
# Install espeak-ng if not installed
|
9 |
if not os.system("which espeak-ng"):
|
@@ -12,18 +11,6 @@ else:
|
|
12 |
os.system("apt-get -qq -y install espeak-ng")
|
13 |
st.text("Installing espeak-ng...")
|
14 |
|
15 |
-
# Function to install MeCab and its dependencies
|
16 |
-
def install_mecab():
|
17 |
-
try:
|
18 |
-
# Install MeCab dependencies (might fail in Hugging Face Spaces)
|
19 |
-
subprocess.check_call([sys.executable, "-m", "pip", "install", "mecab-ipadic"])
|
20 |
-
except subprocess.CalledProcessError as e:
|
21 |
-
st.error("Failed to install MeCab or its dependencies.")
|
22 |
-
st.error(str(e))
|
23 |
-
|
24 |
-
# Install MeCab-related dependencies
|
25 |
-
install_mecab()
|
26 |
-
|
27 |
# Streamlit App UI Setup
|
28 |
st.title("Text-to-Speech with Kokoro")
|
29 |
st.sidebar.header("Configuration & Instructions")
|
|
|
3 |
import soundfile as sf
|
4 |
import io
|
5 |
import os
|
|
|
6 |
|
7 |
# Install espeak-ng if not installed
|
8 |
if not os.system("which espeak-ng"):
|
|
|
11 |
os.system("apt-get -qq -y install espeak-ng")
|
12 |
st.text("Installing espeak-ng...")
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
# Streamlit App UI Setup
|
15 |
st.title("Text-to-Speech with Kokoro")
|
16 |
st.sidebar.header("Configuration & Instructions")
|