Spaces:
Running
Running
pragneshbarik
commited on
Merge branch 'main' of https://huggingface.co/spaces/pragneshbarik/ebook-gen
Browse files
components/stream_handler.py
CHANGED
@@ -11,8 +11,8 @@ def stream_handler(session_state, chat_stream, prompt, placeholder):
|
|
11 |
full_response = ""
|
12 |
|
13 |
for chunk in chat_stream:
|
14 |
-
if chunk.token
|
15 |
-
full_response += chunk.token
|
16 |
placeholder.markdown(full_response + "▌")
|
17 |
placeholder.markdown(full_response)
|
18 |
|
|
|
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 |
|