Aspik101 commited on
Commit
5dbee45
1 Parent(s): 16c6b0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -23,13 +23,17 @@ with gr.Blocks() as demo:
23
  return "", history + [[user_message, None]]
24
 
25
  def bot(history):
 
26
  stream = llm(prompt = f"Jesteś AI assystentem. Odpowiadaj po polski. <user>: {history}. <assistant>:", **params)
27
  history[-1][1] = ""
 
28
  for character in stream:
29
  history[-1][1] += character
 
30
  time.sleep(0.005)
31
  yield history
32
 
 
33
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
34
  bot, chatbot, chatbot
35
  )
 
23
  return "", history + [[user_message, None]]
24
 
25
  def bot(history):
26
+ print(history)
27
  stream = llm(prompt = f"Jesteś AI assystentem. Odpowiadaj po polski. <user>: {history}. <assistant>:", **params)
28
  history[-1][1] = ""
29
+ answer_save = ""
30
  for character in stream:
31
  history[-1][1] += character
32
+ answer_save += character
33
  time.sleep(0.005)
34
  yield history
35
 
36
+ print(answer_save)
37
  msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
38
  bot, chatbot, chatbot
39
  )