Slimy619 commited on
Commit
354e87f
·
1 Parent(s): 545dd1f

Update space

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -58,7 +58,7 @@ class ChatLLM:
58
  history,
59
  system_message,
60
  ):
61
- history = history or [[]]
62
 
63
  messages = SYS_MSG.replace("SYSTEM_PROMPT", system_message.strip())
64
  for msg in history:
@@ -105,9 +105,9 @@ class ChatLLM:
105
  stop=TOKEN_STOP,
106
  ):
107
  answer = output["choices"][0]["text"]
108
- history[-1][1] += answer
109
  # stream the response
110
- yield history, history
111
 
112
 
113
  def user(message, history):
@@ -256,7 +256,7 @@ if __name__ == "__main__":
256
 
257
  app.launch(
258
  max_threads=40,
259
- share=True,
260
  show_error=True,
261
  quiet=False,
262
  debug=True,
 
58
  history,
59
  system_message,
60
  ):
61
+ history = history or [""]
62
 
63
  messages = SYS_MSG.replace("SYSTEM_PROMPT", system_message.strip())
64
  for msg in history:
 
105
  stop=TOKEN_STOP,
106
  ):
107
  answer = output["choices"][0]["text"]
108
+ history[-1][1] += answer # here we append the answer to the last message in the history
109
  # stream the response
110
+ yield history, answer
111
 
112
 
113
  def user(message, history):
 
256
 
257
  app.launch(
258
  max_threads=40,
259
+ share=False,
260
  show_error=True,
261
  quiet=False,
262
  debug=True,