14-26AA commited on
Commit
7212839
1 Parent(s): 23689bd

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +1 -1
inference.py CHANGED
@@ -64,7 +64,7 @@ def infer(f,speaker,key,reqf0=False):
64
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
65
  x,sourcef0 = get_text(audio,sr,getkey(key))
66
  x_lengths = [np.size(x,1)]
67
- sid = [speaker]
68
  ort_inputs = {'x':x,'x_lengths':x_lengths,'sid':sid,"noise_scale":[0.667],"length_scale":[1.0],"noise_scale_w":[0.8]}
69
  infersession = onnxruntime.InferenceSession("onnxmodel334.onnx")#,providers=['CUDAExecutionProvider'])
70
  ort_output = infersession.run(['audio'], ort_inputs)
 
64
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
65
  x,sourcef0 = get_text(audio,sr,getkey(key))
66
  x_lengths = [np.size(x,1)]
67
+ sid = [int(speaker)]
68
  ort_inputs = {'x':x,'x_lengths':x_lengths,'sid':sid,"noise_scale":[0.667],"length_scale":[1.0],"noise_scale_w":[0.8]}
69
  infersession = onnxruntime.InferenceSession("onnxmodel334.onnx")#,providers=['CUDAExecutionProvider'])
70
  ort_output = infersession.run(['audio'], ort_inputs)