pragneshbarik commited on
Commit
3fbf93c
β€’
1 Parent(s): 24db8bf

removed end token

Browse files
Files changed (1) hide show
  1. components/stream_handler.py +4 -3
components/stream_handler.py CHANGED
@@ -11,9 +11,10 @@ def stream_handler(session_state, chat_stream, prompt, placeholder):
11
  full_response = ""
12
 
13
  for chunk in chat_stream:
14
- if chunk.token.text != "</s>":
15
- full_response += chunk.token.text
16
- placeholder.markdown(full_response + "β–Œ")
 
17
  placeholder.markdown(full_response)
18
 
19
  end_time = time.time()
 
11
  full_response = ""
12
 
13
  for chunk in chat_stream:
14
+ if chunk.token.text in ["</s>", "<|im_end|>"]:
15
+ break;
16
+ full_response += chunk.token.text
17
+ placeholder.markdown(full_response + "β–Œ")
18
  placeholder.markdown(full_response)
19
 
20
  end_time = time.time()