Spaces:
Build error
Build error
fixup
Browse files
app.py
CHANGED
@@ -29,7 +29,8 @@ def chat(message, history=[]):
|
|
29 |
print("HERE WE GO! ", new_user_input_ids)
|
30 |
bot_input_ids = new_user_input_ids
|
31 |
chat_history_ids = model.generate(bot_input_ids, max_length=500, pad_token_id=tokenizer.eos_token_id)
|
32 |
-
|
|
|
33 |
# response = tokenizer.decode(response_ids).replace("<|endoftext|>", "")
|
34 |
bot_input_ids = torch.cat([bot_input_ids, response_ids], dim=-1)
|
35 |
history.push((message, response, bot_input_ids))
|
|
|
29 |
print("HERE WE GO! ", new_user_input_ids)
|
30 |
bot_input_ids = new_user_input_ids
|
31 |
chat_history_ids = model.generate(bot_input_ids, max_length=500, pad_token_id=tokenizer.eos_token_id)
|
32 |
+
response_ids = chat_history_ids[:, bot_input_ids.shape[-1]:][0]
|
33 |
+
response = tokenizer.decode(response_ids, skip_special_tokens=True)
|
34 |
# response = tokenizer.decode(response_ids).replace("<|endoftext|>", "")
|
35 |
bot_input_ids = torch.cat([bot_input_ids, response_ids], dim=-1)
|
36 |
history.push((message, response, bot_input_ids))
|