Hazzzardous commited on
Commit
0263b44
1 Parent(s): bfe6b03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -145,7 +145,7 @@ intro = f'''The following is a verbose and detailed conversation between an AI a
145
  {username}: Tell me about yourself.
146
  FRITZ: My name is Fritz. I am an RNN based Large Language Model (LLM).
147
  '''
148
-
149
  model.loadContext(newctx=intro)
150
  chatState = model.getState()
151
  model.resetState()
@@ -181,11 +181,11 @@ def chat(
181
  print("reset chat state")
182
  else:
183
  if (history[0][0][0].split(':')[0] != username):
184
- model.setState(chatState)
185
  history = [[], model.chatState]
186
  print("username changed, reset state")
187
  else:
188
- model.setState(history[1])
189
  intro = ""
190
 
191
  max_new_tokens = int(max_new_tokens)
145
  {username}: Tell me about yourself.
146
  FRITZ: My name is Fritz. I am an RNN based Large Language Model (LLM).
147
  '''
148
+ model.resetState()
149
  model.loadContext(newctx=intro)
150
  chatState = model.getState()
151
  model.resetState()
181
  print("reset chat state")
182
  else:
183
  if (history[0][0][0].split(':')[0] != username):
184
+ model.setState((chatState[0],chatState[1].clone()))
185
  history = [[], model.chatState]
186
  print("username changed, reset state")
187
  else:
188
+ model.setState((history[1][0],history[1][1].clone()))
189
  intro = ""
190
 
191
  max_new_tokens = int(max_new_tokens)