Update app.py
Browse files
app.py
CHANGED
@@ -118,7 +118,10 @@ def respond(
|
|
118 |
|
119 |
messages.append({"role": "user", "content": message})
|
120 |
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(accelerator.device) #.to('cuda')
|
121 |
-
|
|
|
|
|
|
|
122 |
print('input str = ', input_str)
|
123 |
## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
|
124 |
# with autocast():
|
|
|
118 |
|
119 |
messages.append({"role": "user", "content": message})
|
120 |
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(accelerator.device) #.to('cuda')
|
121 |
+
|
122 |
+
input_ids2 = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, return_tensors="pt").to(accelerator.device) #.to('cuda')
|
123 |
+
|
124 |
+
input_str= str(input_ids2)
|
125 |
print('input str = ', input_str)
|
126 |
## <BOS_TOKEN><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Hello, how are you?<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
|
127 |
# with autocast():
|