Skip to content

Commit

Permalink
Fixed history
Browse files Browse the repository at this point in the history
  • Loading branch information
ViperX7 committed Mar 23, 2023
1 parent 3422533 commit 99a520b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ def load_history(self):
"""load"""
entries = []
if self._conv.data:
self._conv.clean()
# self._conv.clean()
for chats in self._conv[:-1]:
# print(chats)
first_interaction = chats[0]
bots_resp = str(first_interaction[1])
if len(bots_resp.split(" ")) > 6:
bots_resp = " ".join(bots_resp.split(" ")[:6])
entries.append((bots_resp, None))
eprint(entries)
return entries[::-1]

def add_text(self, history, text):
Expand Down
2 changes: 0 additions & 2 deletions alpaca_turbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ def ask_bot_pack(self, question):

self.chat_history[-1] = (question, data.decode("utf-8").strip("\n"))

self.is_ready = False
return data

def ask_bot(self, question):
Expand Down Expand Up @@ -297,7 +296,6 @@ def ask_bot(self, question):

self.chat_history[-1] = (question, data.decode("utf-8").strip("\n"))

self.is_ready = False
return data

@staticmethod
Expand Down

0 comments on commit 99a520b

Please sign in to comment.