mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-19 16:29:47 +08:00
Use Multithread in ONNX Session
This commit is contained in:
parent
7b94189747
commit
e3e147d4f9
@ -90,7 +90,7 @@ class G2PWOnnxConverter:
|
|||||||
sess_options = onnxruntime.SessionOptions()
|
sess_options = onnxruntime.SessionOptions()
|
||||||
sess_options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
|
sess_options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
|
||||||
sess_options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL
|
sess_options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL
|
||||||
sess_options.intra_op_num_threads = 2
|
sess_options.intra_op_num_threads = 2 if torch.cuda.is_available() else 0
|
||||||
try:
|
try:
|
||||||
self.session_g2pW = onnxruntime.InferenceSession(
|
self.session_g2pW = onnxruntime.InferenceSession(
|
||||||
os.path.join(uncompress_path, "g2pW.onnx"),
|
os.path.join(uncompress_path, "g2pW.onnx"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user