ikuner commited on
Commit
b032438
·
verified ·
1 Parent(s): 5fc9465

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,7 +3,8 @@ import torch
3
 
4
  # 假设模型是一个声音合成模型
5
  def synthesize_speech(text):
6
- model = torch.load("mg_e8_s112.pth")
 
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)