tts / download_models.py
darshankr's picture
Upload 795 files
287c28c verified
import subprocess
import os
# languages = ["as", "bn", "brx", "en+hi", "en", "gu", "hi", "kn", "ml", "mni", "mr", "or", "pa", "raj", "ta", "te"]
languages = ["as", "hi", "ta"]
base_url = "https://github.com/AI4Bharat/Indic-TTS/releases/download/v1-checkpoints-release"
def download_and_extract(lang):
if (os.path.exists(f"Indic-TTS/models")):
print(f"Directory Indic-TTS/models exists")
else:
print(f"Creating directory Indic-TTS/models")
os.makedirs(f"Indic-TTS/models")
os.chdir(f"Indic-TTS/models")
print(f"Downloading and extracting {lang}.zip...")
# Run the download and extraction commands, stream output in real-time
subprocess.run(f"wget {base_url}/{lang}.zip", shell=True, check=True)
subprocess.run(f"unzip -o {lang}.zip", shell=True, check=True)
subprocess.run(f"rm {lang}.zip", shell=True, check=True)
download_and_extract("hi")
print("All languages downloaded and extracted.")