Path: blob/master/tensorflow_tts/configs/base_config.py
1558 views
# -*- coding: utf-8 -*-1# Copyright 2020 TensorFlowTTS Team.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14"""Base Config for all config."""1516import abc17import yaml18import os1920from tensorflow_tts.utils.utils import CONFIG_FILE_NAME212223class BaseConfig(abc.ABC):24def set_config_params(self, config_params):25self.config_params = config_params2627def save_pretrained(self, saved_path):28"""Save config to file"""29os.makedirs(saved_path, exist_ok=True)30with open(os.path.join(saved_path, CONFIG_FILE_NAME), "w") as file:31yaml.dump(self.config_params, file, Dumper=yaml.Dumper)323334