Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,7 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
|
|
54 |
#conversation.append({"role": "user", "content": message})
|
55 |
|
56 |
print(f"Conversation is -\n{conversation}")
|
|
|
57 |
|
58 |
input_ids = tokenizer.build_chat_input(message, history=conversation, role='user').input_ids.to(model.device)
|
59 |
#input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
|
|
|
54 |
#conversation.append({"role": "user", "content": message})
|
55 |
|
56 |
print(f"Conversation is -\n{conversation}")
|
57 |
+
stop = StopOnTokens()
|
58 |
|
59 |
input_ids = tokenizer.build_chat_input(message, history=conversation, role='user').input_ids.to(model.device)
|
60 |
#input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
|