mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-05 19:15:34 +00:00
fix: interval option implementation
This commit is contained in:
parent
39431f3cb6
commit
dca26d992e
@ -486,9 +486,10 @@ So you are close to reaching the limit. You have to choose your own value, there
|
||||
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:
|
||||
|
@ -35,7 +35,6 @@ class EPUBBookLoader(BaseBookLoader):
|
||||
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 @@ class EPUBBookLoader(BaseBookLoader):
|
||||
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
|
||||
|
@ -61,12 +61,10 @@ class Gemini(Base):
|
||||
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 @@ class Gemini(Base):
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user