Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Akegarasu committed Mar 20, 2023
1 parent 43d813c commit 8ca2ea6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def append(self, query, output) -> str:

def update_last(self, query, output) -> None:
self.history[-1] = (query, output)
self.rh[-1] = (query, output)

def refresh_last(self) -> None:
query, output = self.history[-1]
query, output = self.rh[-1]
self.rh[-1] = (query, parse_codeblock(output))

def clear(self):
Expand Down
2 changes: 1 addition & 1 deletion modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def predict(query, max_length, top_p, temperature):
flag = False
else:
ctx.update_last(query, output)
yield ctx.history, ""
yield ctx.rh, ""
ctx.refresh_last()
yield ctx.rh, ""

Expand Down

0 comments on commit 8ca2ea6

Please sign in to comment.