From 0e2ed334f24254e794868b71698bf3957621e22a Mon Sep 17 00:00:00 2001 From: mkXultra Date: Fri, 16 Aug 2024 14:04:02 +0900 Subject: [PATCH] chore: refactoring --- book_maker/translator/chatgptapi_translator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book_maker/translator/chatgptapi_translator.py b/book_maker/translator/chatgptapi_translator.py index 9d144b9..f25fff9 100644 --- a/book_maker/translator/chatgptapi_translator.py +++ b/book_maker/translator/chatgptapi_translator.py @@ -399,12 +399,12 @@ class ChatGPTAPI(Base): print(f"Using model list {model_list}") self.model_list = cycle(model_list) - def add_to_batch_translate_queue(self, book_index, text): - self.batch_text_list.append({"book_index": book_index, "text": text}) - def batch_init(self, book_name): self.book_name = self.sanitize_book_name(book_name) + def add_to_batch_translate_queue(self, book_index, text): + self.batch_text_list.append({"book_index": book_index, "text": text}) + def sanitize_book_name(self, book_name): # Replace any characters that are not alphanumeric, underscore, hyphen, or dot with an underscore sanitized_book_name = re.sub(r"[^\w\-_\.]", "_", book_name)