wenmengzhou commited on
Commit
7ea67e7
1 Parent(s): ca87b60

change cosyvoice/cli/frontend.py use cpu provider for onnx to avoid zero gpu error

Browse files
Files changed (1) hide show
  1. cosyvoice/cli/frontend.py +3 -1
cosyvoice/cli/frontend.py CHANGED
@@ -42,7 +42,9 @@ class CosyVoiceFrontEnd:
42
  option.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
43
  option.intra_op_num_threads = 1
44
  self.campplus_session = onnxruntime.InferenceSession(campplus_model, sess_options=option, providers=["CPUExecutionProvider"])
45
- self.speech_tokenizer_session = onnxruntime.InferenceSession(speech_tokenizer_model, sess_options=option, providers=["CUDAExecutionProvider"])
 
 
46
  if os.path.exists(spk2info):
47
  self.spk2info = torch.load(spk2info, map_location=self.device)
48
  self.instruct = instruct
 
42
  option.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
43
  option.intra_op_num_threads = 1
44
  self.campplus_session = onnxruntime.InferenceSession(campplus_model, sess_options=option, providers=["CPUExecutionProvider"])
45
+ # self.speech_tokenizer_session = onnxruntime.InferenceSession(speech_tokenizer_model, sess_options=option, providers=["CUDAExecutionProvider"])
46
+ # use cpu provider for onnx to avoid zero gpu error
47
+ self.speech_tokenizer_session = onnxruntime.InferenceSession(speech_tokenizer_model, sess_options=option, providers=["CPUExecutionProvider"])
48
  if os.path.exists(spk2info):
49
  self.spk2info = torch.load(spk2info, map_location=self.device)
50
  self.instruct = instruct