Fix Pipeline.pipeline for empty f0_file
- Added checks for empty f0_file, skipping faulty inp_f0 creation if empty as it should
This commit is contained in:
parent
75f55ca4d0
commit
db166e9759
@ -341,11 +341,13 @@ class Pipeline(object):
|
|||||||
if hasattr(f0_file, "name"):
|
if hasattr(f0_file, "name"):
|
||||||
try:
|
try:
|
||||||
with open(f0_file.name, "r") as f:
|
with open(f0_file.name, "r") as f:
|
||||||
lines = f.read().strip("\n").split("\n")
|
raw_lines = f.read()
|
||||||
inp_f0 = []
|
if len(raw_lines) > 0:
|
||||||
for line in lines:
|
lines = raw_lines.strip("\n").split("\n")
|
||||||
inp_f0.append([float(i) for i in line.split(",")])
|
inp_f0 = []
|
||||||
inp_f0 = np.array(inp_f0, dtype="float32")
|
for line in lines:
|
||||||
|
inp_f0.append([float(i) for i in line.split(",")])
|
||||||
|
inp_f0 = np.array(inp_f0, dtype="float32")
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
sid = torch.tensor(sid, device=self.device).unsqueeze(0).long()
|
sid = torch.tensor(sid, device=self.device).unsqueeze(0).long()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user