Spaces:
Runtime error
Runtime error
import torch | |
class SpeakerManager(): | |
def __init__(self, speaker_file_path=None): | |
self.speakers = torch.load(speaker_file_path) | |
def name_to_id(self): | |
return self.speakers.keys() | |
def num_speakers(self): | |
return len(self.name_to_id) | |
def speaker_names(self): | |
return list(self.name_to_id.keys()) | |
class LanguageManager(): | |
def __init__(self, config): | |
self.langs = config["languages"] | |
def name_to_id(self): | |
return self.langs | |
def num_languages(self): | |
return len(self.name_to_id) | |
def language_names(self): | |
return list(self.name_to_id) | |