From 44b61d2b9284a5d6c581e6014325d8e419da97fd Mon Sep 17 00:00:00 2001 From: Eren G??lge Date: Thu, 14 Sep 2023 15:22:54 +0200 Subject: [PATCH] Fixup --- TTS/utils/manage.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 79eed828..63ff1fec 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -307,8 +307,9 @@ class ModelManager(object): if answer.lower() == "y": with open(tos_path, "w") as f: f.write("I have read, understood ad agree the Terms and Conditions.") + return True else: - raise Exception("You must agree to the terms of service to use this model.") + return False def tos_agreed(self, model_item, model_full_path): """Check if the user has agreed to the terms of service""" @@ -342,7 +343,9 @@ class ModelManager(object): os.makedirs(output_path, exist_ok=True) # handle TOS if not self.tos_agreed(model_item, output_path): - self.ask_tos(output_path) + if not self.ask_tos(output_path): + os.rmdir(output_path) + raise Exception(" [!] You must agree to the terms of service to use this model.") print(f" > Downloading model to {output_path}") try: if "fairseq" in model_name: