Update inference_test_turkcell_with_intents.py
Browse files
inference_test_turkcell_with_intents.py
CHANGED
@@ -147,7 +147,7 @@ def execute_intent(intent_name, user_input):
|
|
147 |
|
148 |
async def generate_response(text):
|
149 |
messages = [{"role": "user", "content": text}]
|
150 |
-
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt",
|
151 |
eos_token = tokenizer("<|im_end|>", add_special_tokens=False)["input_ids"][0]
|
152 |
|
153 |
input_ids = encodeds.to(model.device)
|
|
|
147 |
|
148 |
async def generate_response(text):
|
149 |
messages = [{"role": "user", "content": text}]
|
150 |
+
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
|
151 |
eos_token = tokenizer("<|im_end|>", add_special_tokens=False)["input_ids"][0]
|
152 |
|
153 |
input_ids = encodeds.to(model.device)
|