Spaces:
Running
on
Zero
Running
on
Zero
11
Browse files- __pycache__/edit_utils_en.cpython-310.pyc +0 -0
- __pycache__/edit_utils_zh.cpython-310.pyc +0 -0
- __pycache__/inference_scale.cpython-310.pyc +0 -0
- app.py +32 -0
- data/__pycache__/tokenizer.cpython-310.pyc +0 -0
- models/__pycache__/ssr.cpython-310.pyc +0 -0
- models/modules/__pycache__/__init__.cpython-310.pyc +0 -0
- models/modules/__pycache__/activation.cpython-310.pyc +0 -0
- models/modules/__pycache__/embedding.cpython-310.pyc +0 -0
- models/modules/__pycache__/scaling.cpython-310.pyc +0 -0
- models/modules/__pycache__/transformer.cpython-310.pyc +0 -0
- models/modules/__pycache__/utils.cpython-310.pyc +0 -0
__pycache__/edit_utils_en.cpython-310.pyc
ADDED
Binary file (3.37 kB). View file
|
|
__pycache__/edit_utils_zh.cpython-310.pyc
ADDED
Binary file (2.88 kB). View file
|
|
__pycache__/inference_scale.cpython-310.pyc
ADDED
Binary file (3.93 kB). View file
|
|
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import re
|
3 |
from num2words import num2words
|
4 |
import gradio as gr
|
@@ -28,8 +29,39 @@ nltk.download('punkt')
|
|
28 |
DEMO_PATH = os.getenv("DEMO_PATH", "./demo")
|
29 |
TMP_PATH = os.getenv("TMP_PATH", "./demo/temp")
|
30 |
MODELS_PATH = os.getenv("MODELS_PATH", "./pretrained_models")
|
|
|
31 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
def get_random_string():
|
34 |
return "".join(str(uuid.uuid4()).split("-"))
|
35 |
|
|
|
1 |
import os
|
2 |
+
import requests
|
3 |
import re
|
4 |
from num2words import num2words
|
5 |
import gradio as gr
|
|
|
29 |
DEMO_PATH = os.getenv("DEMO_PATH", "./demo")
|
30 |
TMP_PATH = os.getenv("TMP_PATH", "./demo/temp")
|
31 |
MODELS_PATH = os.getenv("MODELS_PATH", "./pretrained_models")
|
32 |
+
os.makedirs(MODELS_PATH, exist_ok=True)
|
33 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
34 |
|
35 |
+
# download wmencodec
|
36 |
+
url = "https://huggingface.co/westbrook/SSR-Speech-English/resolve/main/wmencodec.th"
|
37 |
+
filename = os.path.join(MODELS_PATH, "wmencodec.th")
|
38 |
+
response = requests.get(url, stream=True)
|
39 |
+
response.raise_for_status()
|
40 |
+
with open(filename, "wb") as file:
|
41 |
+
for chunk in response.iter_content(chunk_size=8192):
|
42 |
+
file.write(chunk)
|
43 |
+
print(f"File downloaded to: {filename}")
|
44 |
+
|
45 |
+
# download english model
|
46 |
+
url = "https://huggingface.co/westbrook/SSR-Speech-English/resolve/main/English.pth"
|
47 |
+
filename = os.path.join(MODELS_PATH, "English.th")
|
48 |
+
response = requests.get(url, stream=True)
|
49 |
+
response.raise_for_status()
|
50 |
+
with open(filename, "wb") as file:
|
51 |
+
for chunk in response.iter_content(chunk_size=8192):
|
52 |
+
file.write(chunk)
|
53 |
+
print(f"File downloaded to: {filename}")
|
54 |
+
|
55 |
+
# download mandarin model
|
56 |
+
url = "https://huggingface.co/westbrook/SSR-Speech-Mandarin/resolve/main/Mandarin.pth"
|
57 |
+
filename = os.path.join(MODELS_PATH, "Mandarin.pth")
|
58 |
+
response = requests.get(url, stream=True)
|
59 |
+
response.raise_for_status()
|
60 |
+
with open(filename, "wb") as file:
|
61 |
+
for chunk in response.iter_content(chunk_size=8192):
|
62 |
+
file.write(chunk)
|
63 |
+
print(f"File downloaded to: {filename}")
|
64 |
+
|
65 |
def get_random_string():
|
66 |
return "".join(str(uuid.uuid4()).split("-"))
|
67 |
|
data/__pycache__/tokenizer.cpython-310.pyc
ADDED
Binary file (5.52 kB). View file
|
|
models/__pycache__/ssr.cpython-310.pyc
ADDED
Binary file (23.2 kB). View file
|
|
models/modules/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (134 Bytes). View file
|
|
models/modules/__pycache__/activation.cpython-310.pyc
ADDED
Binary file (18.8 kB). View file
|
|
models/modules/__pycache__/embedding.cpython-310.pyc
ADDED
Binary file (3.06 kB). View file
|
|
models/modules/__pycache__/scaling.cpython-310.pyc
ADDED
Binary file (40.3 kB). View file
|
|
models/modules/__pycache__/transformer.cpython-310.pyc
ADDED
Binary file (16.1 kB). View file
|
|
models/modules/__pycache__/utils.cpython-310.pyc
ADDED
Binary file (1.41 kB). View file
|
|