Spaces:
Running
Running
| import os | |
| import shutil | |
| print("Importing locally stored coqui tts models...") | |
| # Define the source directory and the destination base path | |
| source_dir = os.getcwd() # Current working directory | |
| tts_folder = os.path.join(source_dir, 'Base_XTTS_Model') | |
| destination_base = '/home/user/.local/share/' | |
| # Define the destination path for the tts folder | |
| destination_path = os.path.join(destination_base, 'tts') | |
| # Move the entire tts folder | |
| if os.path.exists(tts_folder): | |
| # Remove the destination folder if it exists | |
| if os.path.exists(destination_path): | |
| shutil.rmtree(destination_path) # Remove the existing folder | |
| shutil.move(tts_folder, destination_path) | |
| print(f'Moved: {tts_folder} to {destination_path}') | |
| print("Locally stored base coqui XTTS tts model imported!") | |
| print(os.listdir('/home/user/.local/share/tts')) | |
| else: | |
| print(f'Source path does not exist: {tts_folder}') | |