import os import warnings from config import models_path, results_path, sample_path from setup import setup_environment from synthesis import load_models from interface import create_interface warnings.filterwarnings("ignore") def main(): os.makedirs(models_path, exist_ok=True) os.makedirs(results_path, exist_ok=True) if (not os.path.exists(os.path.join(models_path, 'encoder.pt')) or not os.path.exists(os.path.join(models_path, 'synthesizer.pt')) or not os.path.exists(os.path.join(models_path, 'vocoder_HiFiGAN.pkl')) or not os.path.exists(sample_path)): setup_success = setup_environment() if not setup_success: print("Setup failed. Exiting.") exit(1) print("Setup completed successfully.") load_success = load_models() if not load_success: print("Failed to load models. Exiting.") exit(1) demo = create_interface() demo.launch() if __name__ == "__main__": main()