Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,7 @@ def generate(
|
|
54 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
55 |
conversation.append({"role": "user", "content": message})
|
56 |
|
|
|
57 |
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt", add_generation_prompt=True)
|
58 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
59 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|
|
|
54 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
55 |
conversation.append({"role": "user", "content": message})
|
56 |
|
57 |
+
print("conversation: ", conversation)
|
58 |
input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt", add_generation_prompt=True)
|
59 |
if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
|
60 |
input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
|