-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cumulative translation #148
Conversation
…aker into cumulative-translation
8144fdd
to
6ef21e7
Compare
6ef21e7
to
2baf359
Compare
…aker into cumulative-translation
4eecaa6
to
3523469
Compare
Will take a look later for this PR. |
the function part let me do it is OK, when I got time |
@yihong0618 Ok, I'm trying to get a better prompt so that it can translate the same number of paragraphs as the original paragraphs, and still often have problems |
@hleft FYI, I want to keep the original prompt as default because of that it costs the least tokens cc @ConanChou, most users do not care how good of all, they just want it to help them read, so users can DIY their prompt but we do not change the default one unless we found a better one better for translate and for |
@yihong0618 I mean only modify the default prompt when |
yep thanks~ |
Still in testing, the current main progress is that I understand that it is not enough to just modify the prompt and retry, and some special cases must be manually handled, such as |
change output
8e669d6
to
8badb41
Compare
22f3b2e
to
7773778
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM will test and merge.
amazing work!
LGTM+1. |
Please add the relevant content of the |
refactor: _process_paragraph refactor: translate_paragraphs_acc
5aa35c4
to
cc85d6b
Compare
780147b
to
173b756
Compare
…aker into cumulative-translation
…ingual_book_maker into cumulative-translation
@hleft can this merge now? |
@yihong0618 yes ready |
please check new CI if it failed we need to fix it quick |
Wait for how many tokens have been accumulated before starting the translation
--accumulated_num num
The strange part: I don't know how to judge how the cumulative translation results correspond to the original paragraph, so use
sep = "\n\n\n\n\n"
, ifsep="\n\n"
, it is often translated into the same lineA possible bug is that even if
\n\n\n\n\n,
it may still be translated to the same line, and then there will be problems where the translation appears, this will only affect the last num characters, after which it will return to normalA good effect is that it can understand the context more, and the prompt is more effective
I have used various prompts before to ask it not to translate people's names, but to no avail, with context it works(It will most likely work, and in a few cases it will still translate, but it can be translated to the same name)
left:
right: