Skip to content

Commit cfb13f9

Browse files
committed
fix encoding & path issue
1 parent 4bc8bdf commit cfb13f9

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

inference/svs/gradio/infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def run(self):
8181

8282

8383
if __name__ == '__main__':
84-
gradio_config = yaml.safe_load(open('inference/svs/gradio/gradio_settings.yaml'))
84+
gradio_config = yaml.safe_load(open('inference/svs/gradio/gradio_settings.yaml', encoding='utf-8'))
8585
g = GradioInfer(**gradio_config)
8686
g.run()
8787

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from inference.svs.ds_e2e import DiffSingerE2EInfer
1010

11-
root_dir = os.path.dirname(__file__)
11+
root_dir = os.path.dirname(os.path.abspath(__file__))
1212
os.environ['PYTHONPATH'] = f'"{root_dir}"'
1313

1414
parser = argparse.ArgumentParser(description='Run DiffSinger inference')

usr/configs/popcs_ds_beta6.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ datasets: [
2323
'popcs',
2424
]
2525
test_prefixes: [
26-
'popcs-˵ɢ¾ÍÉ¢',
27-
'popcs-ÒþÐεijá°ò',
26+
'popcs-说散就散',
27+
'popcs-隐形的翅膀',
2828
]
2929

3030
spec_min: [-6.8276, -7.0270, -6.8142, -7.1429, -7.6669, -7.6000, -7.1148, -6.9640,

utils/hparams.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def set_hparams(config='', exp_name='', hparams_str='', print_hparams=True, glob
4545
loaded_config = set()
4646

4747
def load_config(config_fn): # deep first
48-
with open(config_fn) as f:
48+
with open(config_fn, encoding='utf-8') as f:
4949
hparams_ = yaml.safe_load(f)
5050
loaded_config.add(config_fn)
5151
if 'base_config' in hparams_:
@@ -71,7 +71,7 @@ def load_config(config_fn): # deep first
7171
ckpt_config_path = f'{args_work_dir}/config.yaml'
7272
if os.path.exists(ckpt_config_path):
7373
try:
74-
with open(ckpt_config_path) as f:
74+
with open(ckpt_config_path, encoding='utf-8') as f:
7575
saved_hparams.update(yaml.safe_load(f))
7676
except:
7777
pass

vocoders/pwg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def load_pwg_model(config_path, checkpoint_path, stats_path):
1717
# load config
18-
with open(config_path) as f:
18+
with open(config_path, encoding='utf-8') as f:
1919
config = yaml.load(f, Loader=yaml.Loader)
2020

2121
# setup

0 commit comments

Comments
 (0)