Headless-VoxNovel-Demo / import_locally_stored_tts_model_files.py
drewThomasson's picture
Update import_locally_stored_tts_model_files.py
c9dbcc7 verified
raw
history blame
903 Bytes
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, 'local_coqui_tts_models')
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 coqui tts models imported!")
print(os.listdir('/home/user/.local/share/tts'))
else:
print(f'Source path does not exist: {tts_folder}')