ebook2audiobook / import_locally_stored_tts_model_files.py
drewThomasson's picture
Update import_locally_stored_tts_model_files.py
a105e1c verified
raw
history blame
840 Bytes
import os
import shutil
print("Importing locally stored coqui tts models...")
# Define the source directory and the destination base path
tts_folder = "/home/user/app/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}')