Skip to content

Commit 38f7e96

Browse files
committed
Fix lint: ruff E713
1 parent ba9b819 commit 38f7e96

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

bins/svc/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def preprocess(cfg, args):
145145
continue
146146
dataset_dir = os.path.join(output_path, dataset)
147147
metadata = []
148-
for split in ["train", "test"] if not "eval" in dataset else ["test"]:
148+
for split in ["train", "test"] if "eval" not in dataset else ["test"]:
149149
metadata_file_path = os.path.join(src_dataset_dir, "{}.json".format(split))
150150
with open(metadata_file_path, "r") as f:
151151
metadata.extend(json.load(f))

bins/tta/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def preprocess(cfg, args):
157157
continue
158158
dataset_dir = os.path.join(output_path, dataset)
159159
metadata = []
160-
for split in ["train", "test"] if not "eval" in dataset else ["test"]:
160+
for split in ["train", "test"] if "eval" not in dataset else ["test"]:
161161
metadata_file_path = os.path.join(src_dataset_dir, "{}.json".format(split))
162162
with open(metadata_file_path, "r") as f:
163163
metadata.extend(json.load(f))

bins/tts/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def preprocess(cfg, args):
198198
continue
199199
dataset_dir = os.path.join(output_path, dataset)
200200
metadata = []
201-
for split in ["train", "test"] if not "eval" in dataset else ["test"]:
201+
for split in ["train", "test"] if "eval" not in dataset else ["test"]:
202202
metadata_file_path = os.path.join(src_dataset_dir, "{}.json".format(split))
203203
with open(metadata_file_path, "r") as f:
204204
metadata.extend(json.load(f))

bins/vocoder/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def preprocess(cfg, args):
119119
continue
120120
dataset_dir = os.path.join(output_path, dataset)
121121
metadata = []
122-
for split in ["train", "test"] if not "eval" in dataset else ["test"]:
122+
for split in ["train", "test"] if "eval" not in dataset else ["test"]:
123123
metadata_file_path = os.path.join(src_dataset_dir, "{}.json".format(split))
124124
with open(metadata_file_path, "r") as f:
125125
metadata.extend(json.load(f))

models/tts/base/tts_inferece.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _load_model(
158158
assert checkpoint_dir is not None
159159
# Load the latest accelerator state dicts
160160
ls = [
161-
str(i) for i in Path(checkpoint_dir).glob("*") if not "audio" in str(i)
161+
str(i) for i in Path(checkpoint_dir).glob("*") if "audio" not in str(i)
162162
]
163163
ls.sort(key=lambda x: int(x.split("_")[-3].split("-")[-1]), reverse=True)
164164
checkpoint_path = ls[0]

models/vocoders/vocoder_inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def _load_model(self, checkpoint_dir, from_multi_gpu=False):
281281
ls = [
282282
str(i)
283283
for i in Path(checkpoint_dir).glob("*")
284-
if not "audio" in str(i)
284+
if "audio" not in str(i)
285285
]
286286
ls.sort(
287287
key=lambda x: int(x.split("/")[-1].split("_")[0].split("-")[-1]),
@@ -443,7 +443,7 @@ def load_nnvocoder(
443443
else:
444444
# Load from accelerator state dict
445445
weights_file = os.path.join(weights_file, "checkpoint")
446-
ls = [str(i) for i in Path(weights_file).glob("*") if not "audio" in str(i)]
446+
ls = [str(i) for i in Path(weights_file).glob("*") if "audio" not in str(i)]
447447
ls.sort(key=lambda x: int(x.split("_")[-3].split("-")[-1]), reverse=True)
448448
checkpoint_path = ls[0]
449449
accelerator = accelerate.Accelerator()

utils/data_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def load_frame_pitch(
149149
pitch_statistic = []
150150
for utt_info in meta_data:
151151
utt = utt_info["Dataset"] + "_" + utt_info["Uid"]
152-
if not utt2spk[utt] in spk2utt:
152+
if utt2spk[utt] not in spk2utt:
153153
spk2utt[utt2spk[utt]] = []
154154
spk2utt[utt2spk[utt]].append(utt)
155155

@@ -242,7 +242,7 @@ def load_phone_pitch(
242242
pitch_statistic = []
243243
for utt_info in tqdm(meta_data):
244244
utt = utt_info["Dataset"] + "_" + utt_info["Uid"]
245-
if not utt2spk[utt] in spk2utt:
245+
if utt2spk[utt] not in spk2utt:
246246
spk2utt[utt2spk[utt]] = []
247247
spk2utt[utt2spk[utt]].append(utt)
248248

@@ -364,7 +364,7 @@ def load_energy(
364364
energy_statistic = []
365365
for utt_info in meta_data:
366366
utt = utt_info["Dataset"] + "_" + utt_info["Uid"]
367-
if not utt2spk[utt] in spk2utt:
367+
if utt2spk[utt] not in spk2utt:
368368
spk2utt[utt2spk[utt]] = []
369369
spk2utt[utt2spk[utt]].append(utt)
370370

@@ -438,7 +438,7 @@ def load_frame_energy(
438438
energy_statistic = []
439439
for utt_info in meta_data:
440440
utt = utt_info["Dataset"] + "_" + utt_info["Uid"]
441-
if not utt2spk[utt] in spk2utt:
441+
if utt2spk[utt] not in spk2utt:
442442
spk2utt[utt2spk[utt]] = []
443443
spk2utt[utt2spk[utt]].append(utt)
444444

0 commit comments

Comments
 (0)