hhguo commited on
Commit
6322243
·
1 Parent(s): 457ab3c
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -1,11 +1,25 @@
1
  import gradio as gr
2
  import os
 
3
  from fireredtts.fireredtts import FireRedTTS
4
 
5
 
6
- gpt_path = 'https://huggingface.co/fireredteam/FireRedTTS/resolve/main/fireredtts_gpt.pt'
7
- speaker_path = 'https://huggingface.co/fireredteam/FireRedTTS/resolve/main/fireredtts_speaker.bin'
8
- decoder_path = 'https://huggingface.co/fireredteam/FireRedTTS/resolve/main/fireredtts_token2wav.pt'
 
 
 
 
 
 
 
 
 
 
 
 
 
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(