add characters to system
This commit is contained in:
parent
ca81bea633
commit
ae24bdcba2
1 changed files with 4 additions and 6 deletions
|
|
@ -268,6 +268,7 @@ def translateLines(linesList, pbar):
|
||||||
if len(translatedBatch) == 0:
|
if len(translatedBatch) == 0:
|
||||||
insertBool = False
|
insertBool = False
|
||||||
batchStartIndex = i
|
batchStartIndex = i
|
||||||
|
pbar.update(1)
|
||||||
batch.clear()
|
batch.clear()
|
||||||
|
|
||||||
currentGroup = []
|
currentGroup = []
|
||||||
|
|
@ -424,16 +425,13 @@ def createContext(fullPromptFlag, subbedT):
|
||||||
|
|
||||||
def translateText(characters, system, user, history):
|
def translateText(characters, system, user, history):
|
||||||
# Prompt
|
# Prompt
|
||||||
msg = [{"role": "system", "content": system}]
|
msg = [{"role": "system", "content": system + characters}]
|
||||||
|
|
||||||
# Characters
|
|
||||||
msg.append({"role": "system", "content": characters})
|
|
||||||
|
|
||||||
# History
|
# History
|
||||||
if isinstance(history, list):
|
if isinstance(history, list):
|
||||||
msg.extend([{"role": "system", "content": h} for h in history])
|
msg.extend([{"role": "assistant", "content": h} for h in history])
|
||||||
else:
|
else:
|
||||||
msg.append({"role": "system", "content": history})
|
msg.append({"role": "assistant", "content": history})
|
||||||
|
|
||||||
# Content to TL
|
# Content to TL
|
||||||
msg.append({"role": "user", "content": f'{user}'})
|
msg.append({"role": "user", "content": f'{user}'})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue