Format code (#1193)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-09-14 09:34:30 +09:00
committed by GitHub
parent 72a18e66b6
commit a6456f6d46
15 changed files with 562 additions and 237 deletions

View File

@@ -357,19 +357,13 @@ class RVC:
with torch.no_grad():
if self.if_f0 == 1:
# print(12222222222,feats.device,p_len.device,cache_pitch.device,cache_pitchf.device,sid.device,rate2)
infered_audio = (
self.net_g.infer(
feats, p_len, cache_pitch, cache_pitchf, sid, rate
)[0][0, 0]
.data
.float()
)
infered_audio = self.net_g.infer(
feats, p_len, cache_pitch, cache_pitchf, sid, rate
)[0][0, 0].data.float()
else:
infered_audio = (
self.net_g.infer(feats, p_len, sid, rate)[0][0, 0]
.data
.float()
)
infered_audio = self.net_g.infer(feats, p_len, sid, rate)[0][
0, 0
].data.float()
t5 = ttime()
logger.info(
"Spent time: fea = %.2fs, index = %.2fs, f0 = %.2fs, model = %.2fs",

View File

@@ -3,7 +3,9 @@ from torch.types import Number
@torch.no_grad()
def amp_to_db(x: torch.Tensor, eps=torch.finfo(torch.float64).eps, top_db=40) -> torch.Tensor:
def amp_to_db(
x: torch.Tensor, eps=torch.finfo(torch.float64).eps, top_db=40
) -> torch.Tensor:
"""
Convert the input tensor from amplitude to decibel scale.
@@ -40,7 +42,9 @@ def temperature_sigmoid(x: torch.Tensor, x0: float, temp_coeff: float) -> torch.
@torch.no_grad()
def linspace(start: Number, stop: Number, num: int = 50, endpoint: bool = True, **kwargs) -> torch.Tensor:
def linspace(
start: Number, stop: Number, num: int = 50, endpoint: bool = True, **kwargs
) -> torch.Tensor:
"""
Generate a linearly spaced 1-D tensor.