Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
•
19f5ccc
1
Parent(s):
83a777e
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def dialogpt(text):
|
|
20 |
bot_input_ids = torch.cat([chat_history_ids, new_user_input_ids], dim=-1) if step > 0 else new_user_input_ids
|
21 |
|
22 |
# generated a response while limiting the total chat history to 1000 tokens,
|
23 |
-
chat_history_ids = model.generate(bot_input_ids, max_length=
|
24 |
response = tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)
|
25 |
history.append((text, response))
|
26 |
gr.set_state(history)
|
20 |
bot_input_ids = torch.cat([chat_history_ids, new_user_input_ids], dim=-1) if step > 0 else new_user_input_ids
|
21 |
|
22 |
# generated a response while limiting the total chat history to 1000 tokens,
|
23 |
+
chat_history_ids = model.generate(bot_input_ids, max_length=100, pad_token_id=tokenizer.eos_token_id)
|
24 |
response = tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)
|
25 |
history.append((text, response))
|
26 |
gr.set_state(history)
|