Spaces:
Running
Running
pragneshbarik
commited on
Commit
β’
3fbf93c
1
Parent(s):
24db8bf
removed end token
Browse files
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
|
15 |
-
|
16 |
-
|
|
|
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()
|