reverse history order to use latest history firts

Co-Authored-By: Pavel <32868631+pabik@users.noreply.github.com>
This commit is contained in:
Alex
2023-05-25 16:40:11 +01:00
parent 6b6737613a
commit ffaa22c49b

View File

@@ -176,6 +176,7 @@ def api_answer():
tokens_current_history = 0
tokens_max_history = 1000
#count tokens in history
history.reverse()
for i in history:
if "prompt" in i and "response" in i:
tokens_batch = llm.get_num_tokens(i["prompt"]) + llm.get_num_tokens(i["response"])