Improve LLM Translation (#477)

# PR Checklist
- [x] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [x] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [x] Did you added a type def?

# Description
1. LLM 번역 응답 크기 소프트코딩화
2. LLM도 DOM파서를 통한 문장 단위 및 병렬 번역을 하도록 수정
3. 바깥쪽 태그가 제대로 제거가 안되는 문제 해결
4. 추가적으로, 기본 번역 프롬프트를 ```You are a translator. Translate the following
html or text into {{slot}}. Do not output anything other than the
translation, punctuations and quotation marks.```으로 변경하고 싶습니다.
------
1. Softcoded LLM translation response size
2. Modified LLM to also do sentence-by-sentence and parallel translation
via DOM parser
3. Fixed an issue with outer tags not being removed properly
4. Additionally, I want to change the default translation prompt to
```You are a translator. Translate the following html or text into
{{slot}}. Do not output anything other than the translation,
punctuations and quotation marks.```
This commit is contained in:
kwaroran
2024-06-03 17:33:15 +09:00
committed by GitHub
7 changed files with 21 additions and 11 deletions

View File

@@ -472,6 +472,7 @@ export const languageChinese = {
"imgGenInstructions": "图像生成指令",
"usePlainFetchWarn": "请在使用NovelAI时禁用此选项因为它可能导致CORS错误。",
"translationPrompt": "翻译提示",
"translationResponseSize": "翻译响应大小",
"webdeeplwarn": "此选项不推荐在网页版本中使用因为它可能导致CORS错误。",
"saveBackupLocal": "本地保存备份",
"loadBackupLocal": "本地加载备份",

View File

@@ -504,6 +504,7 @@ export const languageEnglish = {
imgGenInstructions: "Image Generation Instructions",
usePlainFetchWarn: "Please disable this option when using NovelAI, as it can cause CORS errors when using NovelAI.",
translationPrompt: "Translation Prompt",
translationResponseSize: "Translation Response Size",
webdeeplwarn: "This option is not recommended for use with web version, as it can cause CORS errors.",
saveBackupLocal: "Save Backup Locally",
loadBackupLocal: "Load Backup Locally",

View File

@@ -469,6 +469,7 @@ export const languageKorean = {
"imgGenInstructions": "이미지 생성 지시사항",
"usePlainFetchWarn": "NovelAI 사용 시 CORS 오류가 발생할 수 있으므로, NovelAI를 사용할 때는 이 옵션을 비활성화해 주세요.",
"translationPrompt": "번역 프롬프트",
"translationResponseSize": "번역 응답 크기",
"webdeeplwarn": "이 옵션은 웹에서는 제대로 작동하지 않을 수 있습니다.",
"saveBackupLocal": "로컬 백업 저장",
"loadBackupLocal": "로컬 백업 불러오기",

View File

@@ -472,6 +472,7 @@ export const languageChineseTraditional = {
"imgGenInstructions": "圖像產生指令",
"usePlainFetchWarn": "請在使用NovelAI時禁用此選項因為它可能導致CORS錯誤。",
"translationPrompt": "翻譯提示",
"translationResponseSize": "翻譯響應大小",
"webdeeplwarn": "此選項不推薦在網頁版本中使用因為它可能導致CORS錯誤。",
"saveBackupLocal": "本地保存備份",
"loadBackupLocal": "本地載入備份",