yihong0618 / bilingual_book_maker

Make bilingual epub books Using AI translate
MIT License
6.91k stars 1k forks source link

accumulated_num argument doesn't work #359

Closed anselmwang closed 6 months ago

anselmwang commented 6 months ago

Hi,

Thanks for creating this awesome tool. I'd like to use accumulated_num to reduce API cost.

However, the following command python make_book.py --book_name test_books\animal_farm.epub --openai_key %openai_key% --accumulated_num 100 failed due to error "translate_list() takes 2 positional arguments but 3 were given"

Could you help to have a look? Thanks a lot.

yihong0618 commented 6 months ago

this only works for txt files

anselmwang commented 6 months ago

I am surprised you said that. I have fixed this bug by updating one line result_txt_list = self.translate_model.translate_list(wait_p_list, context_flag) to result_txt_list = self.translate_model.translate_list(wait_p_list), just removing the last "context_flag"

And I have translated an EPub file, the final translated file looks perfect for me. Is it because that my input EPub file doesn't have much html tags?

yihong0618 commented 6 months ago

will test it later, thanks for the info