From 054d9c21857e7a115fa5113ad4595392ccb47847 Mon Sep 17 00:00:00 2001 From: Christopher Aedo Date: Wed, 6 Dec 2023 07:09:15 -0800 Subject: [PATCH] delete unneeded tts model, maybe free up GPU ram --- epub2tts.py | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epub2tts.py b/epub2tts.py index a63dfc9..0d45c81 100644 --- a/epub2tts.py +++ b/epub2tts.py @@ -223,6 +223,10 @@ def read_book(self, voice_samples, engine, openai, model_name, speaker, bitrate) print("Loading model: " + self.xtts_model) #This will trigger model load even though we won't use tts object later tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(self.device) + tts = '' + #Don't think the next two lines are needed, but couldn't hurt just in case + gc.collect() + torch.cuda.empty_cache() config = XttsConfig() model_json = self.xtts_model + "/config.json" config.load_json(model_json) diff --git a/setup.py b/setup.py index 17e7d56..a5e07bc 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ author_email='doc@aedo.net', url='https://github.com/aedocw/epub2tts', license='Apache License, Version 2.0', - version='2.0.6', + version='2.0.7', packages=find_packages(), install_requires=requirements, py_modules=['epub2tts'],