Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion egs/zipvoice/local/prepare_token_file_emilia.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_args():

def get_pinyin_tokens(pinyin: Path) -> List[str]:
phones = set()
with open(pinyin, "r") as f:
with open(pinyin, "r", encoding="utf-8") as f:
for line in f:
x = line.strip()
initial = to_initials(x, strict=False)
Expand Down
2 changes: 1 addition & 1 deletion egs/zipvoice_dialog/local/prepare_opendialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def prepare_subset(
logging.info(f"Reading {jsonl_path}")
recordings_path_set = set()
supervision_list = list()
with open(jsonl_path, "r") as fr:
with open(jsonl_path, "r", encoding="utf-8") as fr:
for line in fr:
try:
items = json.loads(line)
Expand Down
1 change: 1 addition & 0 deletions requirements-webui.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gradio
470 changes: 470 additions & 0 deletions webui_zh.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion zipvoice/bin/generate_averaged_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def main():
params.update(vars(args))
params.exp_dir = Path(params.exp_dir)

with open(params.exp_dir / "model.json", "r") as f:
with open(params.exp_dir / "model.json", "r", encoding="utf-8") as f:
model_config = json.load(f)

# Any tokenizer can be used here.
Expand Down
4 changes: 2 additions & 2 deletions zipvoice/bin/infer_zipvoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def generate_list(
total_t_vocoder = []
total_wav_seconds = []

with open(test_list, "r") as fr:
with open(test_list, "r", encoding="utf-8") as fr:
lines = fr.readlines()

for i, line in enumerate(lines):
Expand Down Expand Up @@ -774,7 +774,7 @@ def main():

tokenizer_config = {"vocab_size": tokenizer.vocab_size, "pad_id": tokenizer.pad_id}

with open(model_config, "r") as f:
with open(model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)

if params.model_name == "zipvoice":
Expand Down
4 changes: 2 additions & 2 deletions zipvoice/bin/infer_zipvoice_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ def generate_list(
total_t_vocoder = []
total_wav_seconds = []

with open(test_list, "r") as fr:
with open(test_list, "r", encoding="utf-8") as fr:
lines = fr.readlines()

for i, line in enumerate(lines):
Expand Down Expand Up @@ -1202,7 +1202,7 @@ def main():
"spk_b_id": tokenizer.spk_b_id,
}

with open(model_config, "r") as f:
with open(model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)

if params.model_name == "zipvoice_dialog":
Expand Down
4 changes: 2 additions & 2 deletions zipvoice/bin/infer_zipvoice_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def generate_list(
total_t_vocoder = []
total_wav_seconds = []

with open(test_list, "r") as fr:
with open(test_list, "r", encoding="utf-8") as fr:
lines = fr.readlines()

for i, line in enumerate(lines):
Expand Down Expand Up @@ -855,7 +855,7 @@ def main():
assert params.tokenizer == "simple"
tokenizer = SimpleTokenizer(token_file=token_file)

with open(model_config, "r") as f:
with open(model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)

model = OnnxModel(text_encoder_path, fm_decoder_path, num_thread=args.num_thread)
Expand Down
2 changes: 1 addition & 1 deletion zipvoice/bin/onnx_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def main():
tokenizer = SimpleTokenizer(token_file)
tokenizer_config = {"vocab_size": tokenizer.vocab_size, "pad_id": tokenizer.pad_id}

with open(model_config, "r") as f:
with open(model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)

if params.model_name == "zipvoice":
Expand Down
2 changes: 1 addition & 1 deletion zipvoice/bin/prepare_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def prepare_dataset(
# Step 1: Read all unique recording paths
recordings_path_set = set()
supervision_list = list()
with open(tsv_path, "r") as fr:
with open(tsv_path, "r", encoding="utf-8") as fr:
for line in fr:
items = line.strip().split("\t")
if len(items) == 3:
Expand Down
2 changes: 1 addition & 1 deletion zipvoice/bin/train_zipvoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def run(rank, world_size, args):
# Set epoch to a large number to ignore it.
if params.num_iters > 0:
params.num_epochs = 1000000
with open(params.model_config, "r") as f:
with open(params.model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)
params.update(model_config["model"])
params.update(model_config["feature"])
Expand Down
2 changes: 1 addition & 1 deletion zipvoice/bin/train_zipvoice_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def run(rank, world_size, args):
# Set epoch to a large number to ignore it.
if params.num_iters > 0:
params.num_epochs = 1000000
with open(params.model_config, "r") as f:
with open(params.model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)
params.update(model_config["model"])
params.update(model_config["feature"])
Expand Down
2 changes: 1 addition & 1 deletion zipvoice/bin/train_zipvoice_dialog_stereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def run(rank, world_size, args):
# Set epoch to a large number to ignore it.
if params.num_iters > 0:
params.num_epochs = 1000000
with open(params.model_config, "r") as f:
with open(params.model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)
params.update(model_config["model"])
params.update(model_config["feature"])
Expand Down
2 changes: 1 addition & 1 deletion zipvoice/bin/train_zipvoice_distill.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def run(rank, world_size, args):
# Set epoch to a large number to ignore it.
if params.num_iters > 0:
params.num_epochs = 1000000
with open(params.model_config, "r") as f:
with open(params.model_config, "r", encoding="utf-8") as f:
model_config = json.load(f)
params.update(model_config["model"])
params.update(model_config["feature"])
Expand Down