Skip to content

Commit

Permalink
Merge pull request #173 from aedocw/main
Browse files Browse the repository at this point in the history
Trigger docker build
  • Loading branch information
aedocw authored Jan 7, 2024
2 parents c49622b + 544b77c commit 027b9fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion epub2tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(
language,
skipfootnotes,
sayparts,
no_deepspeed,
):
self.source = source
self.bookname = os.path.splitext(os.path.basename(source))[0]
Expand All @@ -59,6 +60,7 @@ def __init__(
self.chapters = []
self.chapters_to_read = []
self.section_names = []
self.no_deepspeed = no_deepspeed
if source.endswith(".epub"):
self.book = epub.read_epub(source)
self.sourcetype = "epub"
Expand Down Expand Up @@ -375,7 +377,10 @@ def read_book(self, voice_samples, engine, openai, model_name, speaker, bitrate)
model_json = self.xtts_model + "/config.json"
config.load_json(model_json)
self.model = Xtts.init_from_config(config)
use_deepspeed = self.is_installed("deepspeed")
if self.no_deepspeed:
use_deepspeed = False
else:
use_deepspeed = self.is_installed("deepspeed")
self.model.load_checkpoint(
config, checkpoint_dir=self.xtts_model, use_deepspeed=use_deepspeed
)
Expand Down Expand Up @@ -686,6 +691,11 @@ def main():
type=str,
help="Export epub contents to file (txt, md coming soon)"
)
parser.add_argument(
"--no-deepspeed",
action="store_true",
help="Disable deepspeed",
)

args = parser.parse_args()
print(args)
Expand All @@ -706,6 +716,7 @@ def main():
language=args.language,
skipfootnotes=args.skipfootnotes,
sayparts=args.sayparts,
no_deepspeed=args.no_deepspeed,
)

print("Language selected: " + mybook.language)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
author_email="[email protected]",
url="https://github.com/aedocw/epub2tts",
license="Apache License, Version 2.0",
version="2.3.4",
version="2.3.5",
packages=find_packages(),
install_requires=requirements,
py_modules=["epub2tts"],
Expand Down

0 comments on commit 027b9fb

Please sign in to comment.