Make style

This commit is contained in:
WeberJulian 2022-05-30 21:52:40 +02:00
parent 9f1670010b
commit 39f31e3d39
2 changed files with 6 additions and 5 deletions

View File

@ -1,14 +1,14 @@
import argparse import argparse
import os import os
from argparse import RawTextHelpFormatter from argparse import RawTextHelpFormatter
import torch
import torch
from tqdm import tqdm from tqdm import tqdm
from TTS.config import load_config from TTS.config import load_config
from TTS.tts.datasets import load_tts_samples from TTS.tts.datasets import load_tts_samples
from TTS.tts.utils.speakers import SpeakerManager
from TTS.tts.utils.managers import save_file from TTS.tts.utils.managers import save_file
from TTS.tts.utils.speakers import SpeakerManager
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="""Compute embedding vectors for each wav file in a dataset.\n\n""" description="""Compute embedding vectors for each wav file in a dataset.\n\n"""

View File

@ -11,7 +11,7 @@ from TTS.encoder.utils.generic_utils import setup_encoder_model
from TTS.utils.audio import AudioProcessor from TTS.utils.audio import AudioProcessor
def load_file(path:str): def load_file(path: str):
if path.endswith(".json"): if path.endswith(".json"):
with fsspec.open(path, "r") as f: with fsspec.open(path, "r") as f:
return json.load(f) return json.load(f)
@ -22,7 +22,7 @@ def load_file(path:str):
raise ValueError("Unsupported file type") raise ValueError("Unsupported file type")
def save_file(obj: Any, path:str): def save_file(obj: Any, path: str):
if path.endswith(".json"): if path.endswith(".json"):
with fsspec.open(path, "w") as f: with fsspec.open(path, "w") as f:
json.dump(obj, f, indent=4) json.dump(obj, f, indent=4)
@ -32,6 +32,7 @@ def save_file(obj: Any, path:str):
else: else:
raise ValueError("Unsupported file type") raise ValueError("Unsupported file type")
class BaseIDManager: class BaseIDManager:
"""Base `ID` Manager class. Every new `ID` manager must inherit this. """Base `ID` Manager class. Every new `ID` manager must inherit this.
It defines common `ID` manager specific functions. It defines common `ID` manager specific functions.