mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-09 00:10:00 +08:00
改用修饰器
This commit is contained in:
parent
6591e86df3
commit
7f8892d004
@ -569,7 +569,8 @@ class TTS:
|
|||||||
'''
|
'''
|
||||||
self.stop_flag = True
|
self.stop_flag = True
|
||||||
|
|
||||||
|
# 使用装饰器
|
||||||
|
@torch.no_grad()
|
||||||
def run(self, inputs:dict):
|
def run(self, inputs:dict):
|
||||||
"""
|
"""
|
||||||
Text to speech inference.
|
Text to speech inference.
|
||||||
@ -600,8 +601,7 @@ class TTS:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 直接给全体套一个torch.no_grad()
|
|
||||||
with torch.no_grad():
|
|
||||||
########## variables initialization ###########
|
########## variables initialization ###########
|
||||||
self.stop_flag:bool = False
|
self.stop_flag:bool = False
|
||||||
text:str = inputs.get("text", "")
|
text:str = inputs.get("text", "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user