更改gpt并行推理时的mask策略为padding left (#2144)

* 更改gpt并行推理时的mask策略为padding left,使batch_infer更接近于naive_infer
减少冗余操作并使用torch_sdpa,以提升推理速度

* rollback tts_infer.yaml
This commit is contained in:
ChasonJiang
2025-03-04 16:45:37 +08:00
committed by GitHub
parent 959a2ddbeb
commit 6dd2f72090
4 changed files with 77 additions and 50 deletions

View File

@@ -145,7 +145,11 @@ class TTS_Config:
self.device = self.configs.get("device", torch.device("cpu"))
self.is_half = self.configs.get("is_half", False)
if str(self.device) == "cpu":
print(f"Warning: Half precision is not supported on CPU, set is_half to False.")
self.is_half = False
else:
self.is_half = self.configs.get("is_half", False)
self.version = version
self.t2s_weights_path = self.configs.get("t2s_weights_path", None)
self.vits_weights_path = self.configs.get("vits_weights_path", None)