Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def predict(input, history=[]):
|
|
17 |
bot_input_ids = torch.cat([torch.tensor(history), new_user_input_ids], dim=-1) if history else new_user_input_ids
|
18 |
|
19 |
# Generate a response
|
20 |
-
chat_history_ids = model.generate(bot_input_ids, max_length=
|
21 |
|
22 |
# Convert the tokens to text
|
23 |
response = tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)
|
|
|
17 |
bot_input_ids = torch.cat([torch.tensor(history), new_user_input_ids], dim=-1) if history else new_user_input_ids
|
18 |
|
19 |
# Generate a response
|
20 |
+
chat_history_ids = model.generate(bot_input_ids, max_length=200, pad_token_id=tokenizer.eos_token_id)
|
21 |
|
22 |
# Convert the tokens to text
|
23 |
response = tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)
|