Spaces:
Runtime error
Runtime error
Abid
commited on
Commit
•
ac41d61
1
Parent(s):
4e58b97
png added
Browse files- app.py +2 -2
- img/rick.gif +0 -0
- img/rick.png +0 -0
app.py
CHANGED
@@ -9,7 +9,7 @@ description = """
|
|
9 |
<p>
|
10 |
<center>
|
11 |
The bot is trained on Rick and Morty dialogues Kaggle Dataset using DialoGPT.
|
12 |
-
<img src="https://gradio.app/assets/img/rick.
|
13 |
</center>
|
14 |
</p>
|
15 |
"""
|
@@ -29,7 +29,7 @@ def predict(input, history=[]):
|
|
29 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
30 |
|
31 |
# generate a response
|
32 |
-
history = model.generate(bot_input_ids, max_length=
|
33 |
|
34 |
# convert the tokens to text, and then split the responses into lines
|
35 |
response = tokenizer.decode(history[0]).replace("<|endoftext|>", "\n")
|
|
|
9 |
<p>
|
10 |
<center>
|
11 |
The bot is trained on Rick and Morty dialogues Kaggle Dataset using DialoGPT.
|
12 |
+
<img src="https://gradio.app/assets/img/rick.png">
|
13 |
</center>
|
14 |
</p>
|
15 |
"""
|
|
|
29 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
30 |
|
31 |
# generate a response
|
32 |
+
history = model.generate(bot_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id).tolist()
|
33 |
|
34 |
# convert the tokens to text, and then split the responses into lines
|
35 |
response = tokenizer.decode(history[0]).replace("<|endoftext|>", "\n")
|
img/rick.gif
DELETED
Binary file (206 kB)
|
|
img/rick.png
ADDED