diff --git a/book_maker/cli.py b/book_maker/cli.py index af1b6af4..bd4e4ab3 100644 --- a/book_maker/cli.py +++ b/book_maker/cli.py @@ -486,9 +486,10 @@ def main(): e.batch_flag = options.batch_flag if options.batch_use_flag: e.batch_use_flag = options.batch_use_flag - if options.interval: - e.interval = options.interval + if options.model == "gemini": + if options.interval: + e.translate_model.set_interval(options.interval) if options.model_list: e.translate_model.set_model_list(options.model_list.split(",")) else: diff --git a/book_maker/loader/epub_loader.py b/book_maker/loader/epub_loader.py index 5f87c66f..c2b14376 100644 --- a/book_maker/loader/epub_loader.py +++ b/book_maker/loader/epub_loader.py @@ -35,7 +35,6 @@ def __init__( context_flag=False, temperature=1.0, context_paragraph_limit=0, - interval=0.01, ): self.epub_name = epub_name self.new_epub = epub.EpubBook() @@ -46,7 +45,6 @@ def __init__( context_flag=context_flag, context_paragraph_limit=context_paragraph_limit, temperature=temperature, - interval=interval, **prompt_config_to_kwargs(prompt_config), ) self.is_test = is_test diff --git a/book_maker/translator/gemini_translator.py b/book_maker/translator/gemini_translator.py index 34e02eb7..2ac63785 100644 --- a/book_maker/translator/gemini_translator.py +++ b/book_maker/translator/gemini_translator.py @@ -61,12 +61,10 @@ def __init__( prompt_sys_msg=None, context_flag=False, temperature=1.0, - interval=0.01, **kwargs, ) -> None: super().__init__(key, language) self.context_flag = context_flag - self.interval = interval self.prompt = ( prompt_template or environ.get(PROMPT_ENV_MAP["user"]) @@ -161,6 +159,9 @@ def translate(self, text): t_text = str(num) + "\n" + t_text return t_text + def set_interval(self, interval): + self.interval = interval + def set_geminipro_models(self): self.set_models(GEMINIPRO_MODEL_LIST)