fixed get_cmd and use MAIN_ROOT in ge2e

pull/2412/head
iftaken 3 years ago
parent 6a575218fa
commit 512f20d0bf

@ -52,19 +52,19 @@ class SAT:
voc_stat = os.path.join(self.zh_voc_model_path, "feats_stats.npy")
cmd = self.get_cmd(
task_name,
input_name,
old_str,
new_str,
config_path,
phones_dict,
erniesat_ckpt,
erniesat_stat,
voc,
voc_config,
voc_ckpt,
voc_stat,
output_name,
task_name=task_name,
input_name=input_name,
old_str=old_str,
new_str=new_str,
config_path=config_path,
phones_dict=phones_dict,
erniesat_ckpt=erniesat_ckpt,
erniesat_stat=erniesat_stat,
voc=voc,
voc_config=voc_config,
voc_ckpt=voc_ckpt,
voc_stat=voc_stat,
output_name=output_name,
source_lang="zh",
target_lang="zh")
@ -94,10 +94,22 @@ class SAT:
"snapshot_iter_2500000.pdz")
voc_stat = os.path.join(self.cross_voc_model_path, "feats_stats.npy")
task_name = "synthesize"
cmd = self.get_cmd(task_name, input_name, old_str, new_str, config_path,
phones_dict, erniesat_ckpt, erniesat_stat, voc,
voc_config, voc_ckpt, voc_stat, output_name,
source_lang, target_lang)
cmd = self.get_cmd(
task_name=task_name,
input_name=input_name,
old_str=old_str,
new_str=new_str,
config_path=config_path,
phones_dict=phones_dict,
erniesat_ckpt=erniesat_ckpt,
erniesat_stat=erniesat_stat,
voc=voc,
voc_config=voc_config,
voc_ckpt=voc_ckpt,
voc_stat=voc_stat,
output_name=output_name,
source_lang=source_lang,
target_lang=target_lang)
return run_cmd(cmd, output_name)
@ -125,27 +137,40 @@ class SAT:
voc_stat = os.path.join(self.zh_voc_model_path, "feats_stats.npy")
cmd = self.get_cmd(
task_name,
input_name,
old_str,
new_str,
config_path,
phones_dict,
erniesat_ckpt,
erniesat_stat,
voc,
voc_config,
voc_ckpt,
voc_stat,
output_name,
task_name=task_name,
input_name=input_name,
old_str=old_str,
new_str=new_str,
config_path=config_path,
phones_dict=phones_dict,
erniesat_ckpt=erniesat_ckpt,
erniesat_stat=erniesat_stat,
voc=voc,
voc_config=voc_config,
voc_ckpt=voc_ckpt,
voc_stat=voc_stat,
output_name=output_name,
source_lang="en",
target_lang="en")
return run_cmd(cmd, output_name)
def get_cmd(self, task_name, input_name, old_str, new_str, config_path,
phones_dict, erniesat_ckpt, erniesat_stat, voc, voc_config,
voc_ckpt, voc_stat, output_name, source_lang, target_lang):
def get_cmd(self,
task_name: str,
input_name: str,
old_str: str,
new_str: str,
config_path: str,
phones_dict: str,
erniesat_ckpt: str,
erniesat_stat: str,
voc: str,
voc_config: str,
voc_ckpt: str,
voc_stat: str,
output_name: str,
source_lang: str,
target_lang: str):
cmd = f"""
FLAGS_allocator_strategy=naive_best_fit \
FLAGS_fraction_of_gpu_memory_to_use=0.01 \

@ -1,16 +1,14 @@
import os
import shutil
from .util import MAIN_ROOT
from .util import run_cmd
class VoiceCloneGE2E():
def __init__(self):
# Path 到指定路径上
self.now_file_path = os.path.dirname(__file__)
self.BIN_DIR = os.path.realpath(
os.path.join(self.now_file_path,
"../../../../paddlespeech/t2s/exps"))
self.BIN_DIR = os.path.join(MAIN_ROOT, "paddlespeech/t2s/exps")
# am
self.am = "fastspeech2_aishell3"
self.am_config = "source/model/fastspeech2_nosil_aishell3_vc1_ckpt_0.5/default.yaml"

Loading…
Cancel
Save