pabloce commited on
Commit
92d9ef4
·
verified ·
1 Parent(s): 7e5587a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,10 +28,10 @@ def respond(
28
  temperature,
29
  top_p,
30
  ):
31
- stop_tokens = ["</s>", "[INST]", "[INST] ", "<s>", "[/INST]", "[/INST] "]
32
  chat_template = '<s>[INST] ' + system_message
33
- for human, assistant in history:
34
- chat_template += human + ' [/INST] ' + assistant + '</s>[INST]'
35
  chat_template += ' ' + message + ' [/INST]'
36
 
37
  print(chat_template)
@@ -55,7 +55,7 @@ def respond(
55
  verbose=True,
56
  )
57
  response = ""
58
- for chunk in llm.stream_chat(message):
59
  print(chunk.delta, end="", flush=True)
60
  response += str(chunk.delta)
61
  yield response
 
28
  temperature,
29
  top_p,
30
  ):
31
+ # stop_tokens = ["</s>", "[INST]", "[INST] ", "<s>", "[/INST]", "[/INST] "]
32
  chat_template = '<s>[INST] ' + system_message
33
+ # for human, assistant in history:
34
+ # chat_template += human + ' [/INST] ' + assistant + '</s>[INST]'
35
  chat_template += ' ' + message + ' [/INST]'
36
 
37
  print(chat_template)
 
55
  verbose=True,
56
  )
57
  response = ""
58
+ for chunk in llm.stream_chat(chat_template):
59
  print(chunk.delta, end="", flush=True)
60
  response += str(chunk.delta)
61
  yield response