Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,11 @@ def respond(
|
|
48 |
settings.temperature = temperature
|
49 |
settings.top_p = top_p
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
# stop_tokens = ["</s>", "[INST]", "[INST] ", "<s>", "[/INST]", "[/INST] "]
|
53 |
# chat_template = '<s>[INST] ' + system_message
|
54 |
# # for human, assistant in history:
|
|
|
48 |
settings.temperature = temperature
|
49 |
settings.top_p = top_p
|
50 |
|
51 |
+
for new_token in agent.get_chat_response(message, llm_sampling_settings=settings, returns_streaming_generator=True):
|
52 |
+
partial_message += new_token
|
53 |
+
if '<|im_end|>' in partial_message:
|
54 |
+
break
|
55 |
+
yield partial_message
|
56 |
# stop_tokens = ["</s>", "[INST]", "[INST] ", "<s>", "[/INST]", "[/INST] "]
|
57 |
# chat_template = '<s>[INST] ' + system_message
|
58 |
# # for human, assistant in history:
|