rphrp1985 commited on
Commit
1513f9c
·
verified ·
1 Parent(s): c449235

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- input_str= str(input_ids)
 
 
 
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():