Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def generate_text(prompt, max_length, temperature):
|
|
18 |
{"role": "system", "content": "You are a helpful assistant."},
|
19 |
{"role": "user", "content": prompt}
|
20 |
]
|
21 |
-
formatted_prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=
|
22 |
|
23 |
inputs = tokenizer(formatted_prompt, return_tensors="pt").to(model.device)
|
24 |
|
|
|
18 |
{"role": "system", "content": "You are a helpful assistant."},
|
19 |
{"role": "user", "content": prompt}
|
20 |
]
|
21 |
+
formatted_prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=False, tokenize=False)
|
22 |
|
23 |
inputs = tokenizer(formatted_prompt, return_tensors="pt").to(model.device)
|
24 |
|