Spaces:
Running
on
Zero
Running
on
Zero
update
Browse files
app.py
CHANGED
@@ -1,11 +1,25 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
|
|
3 |
from fireredtts.fireredtts import FireRedTTS
|
4 |
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
|
11 |
tts = FireRedTTS(
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
+
import requests
|
4 |
from fireredtts.fireredtts import FireRedTTS
|
5 |
|
6 |
|
7 |
+
def download_file(url, filename):
|
8 |
+
response = requests.get(url)
|
9 |
+
if response.status_code == 200:
|
10 |
+
with open(filename, 'wb') as file:
|
11 |
+
file.write(response.content)
|
12 |
+
print(f"File downloaded successfully: {filename}")
|
13 |
+
else:
|
14 |
+
print(f"Failed to download file: HTTP {response.status_code}")
|
15 |
+
|
16 |
+
|
17 |
+
download_file('https://huggingface.co/fireredteam/FireRedTTS/resolve/main/fireredtts_gpt.pt',
|
18 |
+
'pretrained_models/fireredtts_gpt.pt')
|
19 |
+
download_file('https://huggingface.co/fireredteam/FireRedTTS/resolve/main/fireredtts_speaker.bin',
|
20 |
+
'pretrained_models/fireredtts_speaker.bin')
|
21 |
+
download_file('https://huggingface.co/fireredteam/FireRedTTS/resolve/main/fireredtts_token2wav.pt',
|
22 |
+
'pretrained_models/fireredtts_token2wav.pt')
|
23 |
|
24 |
|
25 |
tts = FireRedTTS(
|