unijoh commited on
Commit
e26488d
1 Parent(s): b6e9e66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -1,4 +1,3 @@
1
- import os
2
  import subprocess
3
  import sys
4
 
@@ -6,6 +5,13 @@ import sys
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",
@@ -25,6 +31,8 @@ required_packages = [
25
  "matplotlib",
26
  "gradio==3.1.4",
27
  "sentencepiece",
 
 
28
  "resampy>=0.2.2",
29
  "numba>=0.43.0",
30
  "soundfile>=0.10.2",
@@ -72,4 +80,5 @@ iface = gr.Interface(
72
  )
73
 
74
  if __name__ == "__main__":
 
75
  iface.launch()
 
 
1
  import subprocess
2
  import sys
3
 
 
5
  def install_package(package):
6
  subprocess.check_call([sys.executable, "-m", "pip", "install", package])
7
 
8
+ # Install Rust compiler if not present
9
+ def install_rust():
10
+ try:
11
+ subprocess.check_call(["rustc", "--version"])
12
+ except subprocess.CalledProcessError:
13
+ subprocess.check_call(["curl", "--proto", "=https", "--tlsv1.2", "-sSf", "https://sh.rustup.rs", "|", "sh"])
14
+
15
  # List of required packages
16
  required_packages = [
17
  "transformers==4.10.3",
 
31
  "matplotlib",
32
  "gradio==3.1.4",
33
  "sentencepiece",
34
+ "sacremoses",
35
+ "tokenizers==0.10.3",
36
  "resampy>=0.2.2",
37
  "numba>=0.43.0",
38
  "soundfile>=0.10.2",
 
80
  )
81
 
82
  if __name__ == "__main__":
83
+ install_rust()
84
  iface.launch()