gz412 commited on
Commit
090790e
·
1 Parent(s): d8082b6

test app.py

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. cosyvoice/cli/model.py +5 -0
app.py CHANGED
@@ -48,7 +48,7 @@ def tts_inference(model_choice, text, prompt_audio):
48
  else:
49
  return None, "未知模型"
50
 
51
- model.cuda()
52
 
53
  # 繁简转换
54
  text = converter.convert(text)
 
48
  else:
49
  return None, "未知模型"
50
 
51
+ model.model.cuda()
52
 
53
  # 繁简转换
54
  text = converter.convert(text)
cosyvoice/cli/model.py CHANGED
@@ -266,6 +266,11 @@ class CosyVoice2Model(CosyVoiceModel):
266
  self.tts_speech_token_dict = {}
267
  self.llm_end_dict = {}
268
  self.hift_cache_dict = {}
 
 
 
 
 
269
 
270
  def load_jit(self, flow_encoder_model):
271
  flow_encoder = torch.jit.load(flow_encoder_model, map_location=self.device)
 
266
  self.tts_speech_token_dict = {}
267
  self.llm_end_dict = {}
268
  self.hift_cache_dict = {}
269
+
270
+ def cuda(self):
271
+ self.llm.cuda()
272
+ self.flow.cuda()
273
+ self.hift.cuda()
274
 
275
  def load_jit(self, flow_encoder_model):
276
  flow_encoder = torch.jit.load(flow_encoder_model, map_location=self.device)