artificialguybr commited on
Commit
be3c447
1 Parent(s): f6fc9d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -50,16 +50,18 @@ def stream_chat(
50
  for prompt, answer in history:
51
  chat_history.append((prompt, answer))
52
 
53
- for response, _ in model.stream_chat(
54
  tokenizer,
55
  message,
56
- chat_history,
57
  max_new_tokens=max_new_tokens,
58
  top_p=top_p,
59
  top_k=top_k,
60
  temperature=temperature,
61
- ):
62
- yield response
 
 
63
 
64
  chatbot = gr.Chatbot(height=600, placeholder=PLACEHOLDER)
65
 
 
50
  for prompt, answer in history:
51
  chat_history.append((prompt, answer))
52
 
53
+ response, _ = model.chat(
54
  tokenizer,
55
  message,
56
+ history=chat_history,
57
  max_new_tokens=max_new_tokens,
58
  top_p=top_p,
59
  top_k=top_k,
60
  temperature=temperature,
61
+ )
62
+
63
+ yield response
64
+
65
 
66
  chatbot = gr.Chatbot(height=600, placeholder=PLACEHOLDER)
67