Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ import torch
|
|
3 |
|
4 |
# 假设模型是一个声音合成模型
|
5 |
def synthesize_speech(text):
|
6 |
-
|
|
|
7 |
model.eval()
|
8 |
# 假设你的模型有一个名为 synthesize 的方法
|
9 |
audio_output = model.synthesize(text)
|
|
|
3 |
|
4 |
# 假设模型是一个声音合成模型
|
5 |
def synthesize_speech(text):
|
6 |
+
# 加载模型并映射到 CPU
|
7 |
+
model = torch.load("mg_e8_s112.pth", map_location=torch.device('cpu'))
|
8 |
model.eval()
|
9 |
# 假设你的模型有一个名为 synthesize 的方法
|
10 |
audio_output = model.synthesize(text)
|