Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,8 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
|
|
64 |
conversation.append({"role": "user", "content": message})
|
65 |
|
66 |
input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
67 |
-
|
|
|
68 |
gen_tokens= model.generate(
|
69 |
input_ids,
|
70 |
max_new_tokens=max_new_tokens,
|
|
|
64 |
conversation.append({"role": "user", "content": message})
|
65 |
|
66 |
input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
67 |
+
prompt_padded_len = len(input_ids[0])
|
68 |
+
|
69 |
gen_tokens= model.generate(
|
70 |
input_ids,
|
71 |
max_new_tokens=max_new_tokens,
|