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:
@@ -5,7 +5,8 @@
|
||||
import { sleep } from "src/ts/util";
|
||||
import OptionInput from "src/lib/UI/GUI/OptionInput.svelte";
|
||||
import SelectInput from "src/lib/UI/GUI/SelectInput.svelte";
|
||||
import { alertNormal, alertSelect } from "src/ts/alert";
|
||||
import NumberInput from "src/lib/UI/GUI/NumberInput.svelte";
|
||||
import { alertNormal, alertSelect, alertConfirm } from "src/ts/alert";
|
||||
import { downloadFile, isTauri } from "src/ts/storage/globalApi";
|
||||
import { languageEnglish } from "src/lang/en";
|
||||
import TextInput from "src/lib/UI/GUI/TextInput.svelte";
|
||||
@@ -111,7 +112,8 @@
|
||||
{/if}
|
||||
|
||||
{#if $DataBase.translatorType === 'llm'}
|
||||
<span class="text-textcolor mt-4">{language.translationPrompt}</span>
|
||||
<span class="text-textcolor mt-4">{language.translationResponseSize}</span>
|
||||
<NumberInput min={0} max={2048} marginBottom={true} bind:value={$DataBase.translatorMaxResponse}/>
|
||||
<TextAreaInput bind:value={$DataBase.translatorPrompt} placeholder={"You are a translator. translate the following html or text into {{slot}}. do not output anything other than the translation."}/>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user