Skip to content

Commit b0f8a4c

Browse files
authored
fix: json format (#84)
* Update extract_locale.py * Apply Code Formatter Change * Update locale_diff.py * Apply Code Formatter Change --------- Co-authored-by: fumiama <[email protected]>
1 parent 5ab6713 commit b0f8a4c

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

extract_locale.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ def process(fn: str):
2828
# Save as a JSON file
2929
with open("./i18n/zh_CN.json", "w", encoding="utf-8") as f:
3030
json.dump(data, f, ensure_ascii=False, indent=4)
31+
f.write("\n")

gui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import os,sys
1+
import os, sys
2+
23
now_dir = os.getcwd()
34
sys.path.append(now_dir)
45
import PySimpleGUI as sg

i18n/locale_diff.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@
4242
# Save the updated language file
4343
with open(lang_file, "w", encoding="utf-8") as f:
4444
json.dump(lang_data, f, ensure_ascii=False, indent=4)
45+
f.write("\n")

infer-web.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,17 @@ def vc_single(
139139
if hubert_model == None:
140140
load_hubert()
141141
if_f0 = cpt.get("f0", 1)
142-
file_index = file_index.strip(" ").strip('"').strip("\n").strip('"').strip(" ").replace("trained","added")#防止小白写错,自动帮他替换掉
143-
file_big_npy = file_big_npy.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
142+
file_index = (
143+
file_index.strip(" ")
144+
.strip('"')
145+
.strip("\n")
146+
.strip('"')
147+
.strip(" ")
148+
.replace("trained", "added")
149+
) # 防止小白写错,自动帮他替换掉
150+
file_big_npy = (
151+
file_big_npy.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
152+
)
144153
audio_opt = vc.pipeline(
145154
hubert_model,
146155
net_g,

trainset_preprocess_pipeline_print.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, sr, exp_dir):
3939
max_sil_kept=150,
4040
)
4141
self.sr = sr
42-
self.bh, self.ah = signal.butter(N=5, Wn=48, btype='high', fs=self.sr)
42+
self.bh, self.ah = signal.butter(N=5, Wn=48, btype="high", fs=self.sr)
4343
self.per = 3.7
4444
self.overlap = 0.3
4545
self.tail = self.per + self.overlap

vc_infer_pipeline.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import scipy.signal as signal
66
import pyworld, os, traceback, faiss
77
from scipy import signal
8-
bh, ah = signal.butter(N=5, Wn=48, btype='high', fs=16000)
8+
9+
bh, ah = signal.butter(N=5, Wn=48, btype="high", fs=16000)
10+
911

1012
class VC(object):
1113
def __init__(self, tgt_sr, device, is_half):

0 commit comments

Comments
 (0)