import os
from pathlib import Path


class Paths:
    """Manages and configures the paths used by WaveRNN, Tacotron, and the data."""
    def __init__(self, data_path, voc_id):
        self.base = Path(__file__).parent.parent.parent.expanduser().resolve()

        # Data Paths
        self.data = Path(data_path).expanduser().resolve()
        self.quant = self.data/'quant'
        self.gta = self.data/'mel'

        # WaveRNN/Vocoder Paths
        self.voc_checkpoints = self.base/'checkpoints'/f'{voc_id}.wavernn'
        self.voc_latest_weights = self.voc_checkpoints/'latest_weights.pyt'
        self.voc_latest_optim = self.voc_checkpoints/'latest_optim.pyt'
        self.voc_latest_scheduler = self.voc_checkpoints/'latest_scheduler.pyt'
        self.voc_output = self.base/'model_outputs'/f'{voc_id}.wavernn'
        self.voc_step = self.voc_checkpoints/'step.npy'
        self.voc_log = self.voc_checkpoints/'log.txt'

        self.create_paths()

    def create_paths(self):
        os.makedirs(self.data, exist_ok=True)
        os.makedirs(self.quant, exist_ok=True)
        os.makedirs(self.gta, exist_ok=True)
        os.makedirs(self.voc_checkpoints, exist_ok=True)
        os.makedirs(self.voc_output, exist_ok=True)
    
    def get_voc_named_weights(self, name):
        """Gets the path for the weights in a named voc checkpoint."""
        return self.voc_checkpoints/f'{name}_weights.pyt'

    def get_voc_named_optim(self, name):
        """Gets the path for the optimizer state in a named voc checkpoint."""
        return self.voc_checkpoints/f'{name}_optim.pyt'

a69b8ae73ec2100f452a49e51be50f271dd752a3
<mask token>


class Paths:
    <mask token>

    def __init__(self, data_path, voc_id):
        self.base = Path(__file__).parent.parent.parent.expanduser().resolve()
        self.data = Path(data_path).expanduser().resolve()
        self.quant = self.data / 'quant'
        self.gta = self.data / 'mel'
        self.voc_checkpoints = self.base / 'checkpoints' / f'{voc_id}.wavernn'
        self.voc_latest_weights = self.voc_checkpoints / 'latest_weights.pyt'
        self.voc_latest_optim = self.voc_checkpoints / 'latest_optim.pyt'
        self.voc_latest_scheduler = (self.voc_checkpoints /
            'latest_scheduler.pyt')
        self.voc_output = self.base / 'model_outputs' / f'{voc_id}.wavernn'
        self.voc_step = self.voc_checkpoints / 'step.npy'
        self.voc_log = self.voc_checkpoints / 'log.txt'
        self.create_paths()
    <mask token>

    def get_voc_named_weights(self, name):
        """Gets the path for the weights in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_weights.pyt'

    def get_voc_named_optim(self, name):
        """Gets the path for the optimizer state in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_optim.pyt'

<mask token>


class Paths:
    <mask token>

    def __init__(self, data_path, voc_id):
        self.base = Path(__file__).parent.parent.parent.expanduser().resolve()
        self.data = Path(data_path).expanduser().resolve()
        self.quant = self.data / 'quant'
        self.gta = self.data / 'mel'
        self.voc_checkpoints = self.base / 'checkpoints' / f'{voc_id}.wavernn'
        self.voc_latest_weights = self.voc_checkpoints / 'latest_weights.pyt'
        self.voc_latest_optim = self.voc_checkpoints / 'latest_optim.pyt'
        self.voc_latest_scheduler = (self.voc_checkpoints /
            'latest_scheduler.pyt')
        self.voc_output = self.base / 'model_outputs' / f'{voc_id}.wavernn'
        self.voc_step = self.voc_checkpoints / 'step.npy'
        self.voc_log = self.voc_checkpoints / 'log.txt'
        self.create_paths()

    def create_paths(self):
        os.makedirs(self.data, exist_ok=True)
        os.makedirs(self.quant, exist_ok=True)
        os.makedirs(self.gta, exist_ok=True)
        os.makedirs(self.voc_checkpoints, exist_ok=True)
        os.makedirs(self.voc_output, exist_ok=True)

    def get_voc_named_weights(self, name):
        """Gets the path for the weights in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_weights.pyt'

    def get_voc_named_optim(self, name):
        """Gets the path for the optimizer state in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_optim.pyt'

<mask token>


class Paths:
    """Manages and configures the paths used by WaveRNN, Tacotron, and the data."""

    def __init__(self, data_path, voc_id):
        self.base = Path(__file__).parent.parent.parent.expanduser().resolve()
        self.data = Path(data_path).expanduser().resolve()
        self.quant = self.data / 'quant'
        self.gta = self.data / 'mel'
        self.voc_checkpoints = self.base / 'checkpoints' / f'{voc_id}.wavernn'
        self.voc_latest_weights = self.voc_checkpoints / 'latest_weights.pyt'
        self.voc_latest_optim = self.voc_checkpoints / 'latest_optim.pyt'
        self.voc_latest_scheduler = (self.voc_checkpoints /
            'latest_scheduler.pyt')
        self.voc_output = self.base / 'model_outputs' / f'{voc_id}.wavernn'
        self.voc_step = self.voc_checkpoints / 'step.npy'
        self.voc_log = self.voc_checkpoints / 'log.txt'
        self.create_paths()

    def create_paths(self):
        os.makedirs(self.data, exist_ok=True)
        os.makedirs(self.quant, exist_ok=True)
        os.makedirs(self.gta, exist_ok=True)
        os.makedirs(self.voc_checkpoints, exist_ok=True)
        os.makedirs(self.voc_output, exist_ok=True)

    def get_voc_named_weights(self, name):
        """Gets the path for the weights in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_weights.pyt'

    def get_voc_named_optim(self, name):
        """Gets the path for the optimizer state in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_optim.pyt'

import os
from pathlib import Path


class Paths:
    """Manages and configures the paths used by WaveRNN, Tacotron, and the data."""

    def __init__(self, data_path, voc_id):
        self.base = Path(__file__).parent.parent.parent.expanduser().resolve()
        self.data = Path(data_path).expanduser().resolve()
        self.quant = self.data / 'quant'
        self.gta = self.data / 'mel'
        self.voc_checkpoints = self.base / 'checkpoints' / f'{voc_id}.wavernn'
        self.voc_latest_weights = self.voc_checkpoints / 'latest_weights.pyt'
        self.voc_latest_optim = self.voc_checkpoints / 'latest_optim.pyt'
        self.voc_latest_scheduler = (self.voc_checkpoints /
            'latest_scheduler.pyt')
        self.voc_output = self.base / 'model_outputs' / f'{voc_id}.wavernn'
        self.voc_step = self.voc_checkpoints / 'step.npy'
        self.voc_log = self.voc_checkpoints / 'log.txt'
        self.create_paths()

    def create_paths(self):
        os.makedirs(self.data, exist_ok=True)
        os.makedirs(self.quant, exist_ok=True)
        os.makedirs(self.gta, exist_ok=True)
        os.makedirs(self.voc_checkpoints, exist_ok=True)
        os.makedirs(self.voc_output, exist_ok=True)

    def get_voc_named_weights(self, name):
        """Gets the path for the weights in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_weights.pyt'

    def get_voc_named_optim(self, name):
        """Gets the path for the optimizer state in a named voc checkpoint."""
        return self.voc_checkpoints / f'{name}_optim.pyt'

import os
from pathlib import Path


class Paths:
    """Manages and configures the paths used by WaveRNN, Tacotron, and the data."""
    def __init__(self, data_path, voc_id):
        self.base = Path(__file__).parent.parent.parent.expanduser().resolve()

        # Data Paths
        self.data = Path(data_path).expanduser().resolve()
        self.quant = self.data/'quant'
        self.gta = self.data/'mel'

        # WaveRNN/Vocoder Paths
        self.voc_checkpoints = self.base/'checkpoints'/f'{voc_id}.wavernn'
        self.voc_latest_weights = self.voc_checkpoints/'latest_weights.pyt'
        self.voc_latest_optim = self.voc_checkpoints/'latest_optim.pyt'
        self.voc_latest_scheduler = self.voc_checkpoints/'latest_scheduler.pyt'
        self.voc_output = self.base/'model_outputs'/f'{voc_id}.wavernn'
        self.voc_step = self.voc_checkpoints/'step.npy'
        self.voc_log = self.voc_checkpoints/'log.txt'

        self.create_paths()

    def create_paths(self):
        os.makedirs(self.data, exist_ok=True)
        os.makedirs(self.quant, exist_ok=True)
        os.makedirs(self.gta, exist_ok=True)
        os.makedirs(self.voc_checkpoints, exist_ok=True)
        os.makedirs(self.voc_output, exist_ok=True)
    
    def get_voc_named_weights(self, name):
        """Gets the path for the weights in a named voc checkpoint."""
        return self.voc_checkpoints/f'{name}_weights.pyt'

    def get_voc_named_optim(self, name):
        """Gets the path for the optimizer state in a named voc checkpoint."""
        return self.voc_checkpoints/f'{name}_optim.pyt'
