shukdevdatta123 commited on
Commit
e4167d9
·
verified ·
1 Parent(s): 961a9ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -11,6 +11,18 @@ else:
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")
 
11
  os.system("apt-get -qq -y install espeak-ng")
12
  st.text("Installing espeak-ng...")
13
 
14
+ # Function to install MeCab and its dependencies
15
+ def install_mecab():
16
+ try:
17
+ # Install MeCab dependencies (might fail in Hugging Face Spaces)
18
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "mecab-ipadic"])
19
+ except subprocess.CalledProcessError as e:
20
+ st.error("Failed to install MeCab or its dependencies.")
21
+ st.error(str(e))
22
+
23
+ # Install MeCab-related dependencies
24
+ install_mecab()
25
+
26
  # Streamlit App UI Setup
27
  st.title("Text-to-Speech with Kokoro")
28
  st.sidebar.header("Configuration & Instructions")