Fix: ensure encoding utf-8

This commit is contained in:
litagin02
2024-03-11 09:27:36 +09:00
parent 03d4b4c97e
commit 42ee7d7608
2 changed files with 6 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ from style_bert_vits2.logging import logger
def download_bert_models():
with open("bert/bert_models.json", "r") as fp:
with open("bert/bert_models.json", "r", encoding="utf-8") as fp:
models = json.load(fp)
for k, v in models.items():
local_path = Path("bert").joinpath(k)

View File

@@ -68,6 +68,7 @@ class HyperParametersModelSLM(BaseModel):
nlayers: int = 13
initial_channel: int = 64
class HyperParametersModel(BaseModel):
use_spk_conditioned_encoder: bool = True
use_noise_scaled_mas: bool = True
@@ -98,7 +99,7 @@ class HyperParametersModel(BaseModel):
class HyperParameters(BaseModel):
model_name: str = 'Dummy'
model_name: str = "Dummy"
version: str = "2.0-JP-Extra"
train: HyperParametersTrain = HyperParametersTrain()
data: HyperParametersData = HyperParametersData()
@@ -112,7 +113,6 @@ class HyperParameters(BaseModel):
# model_ 以下を Pydantic の保護対象から除外する
model_config = ConfigDict(protected_namespaces=())
@staticmethod
def load_from_json(json_path: Union[str, Path]) -> "HyperParameters":
"""
@@ -125,5 +125,5 @@ class HyperParameters(BaseModel):
HyperParameters: ハイパーパラメータ
"""
with open(json_path, "r") as f:
with open(json_path, "r", encoding="utf-8") as f:
return HyperParameters.model_validate_json(f.read())