Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,8 @@ def predict(input, history=[]):
|
|
9 |
new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
|
10 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
11 |
history = model.generate(bot_input_ids, max_length=500, pad_token_id=tokenizer.eos_token_id).tolist()
|
12 |
-
response = tokenizer.decode(history[0]).
|
|
|
13 |
|
14 |
html = "<div class='chatbot'>"
|
15 |
for m, msg in enumerate(response):
|
|
|
9 |
new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
|
10 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
11 |
history = model.generate(bot_input_ids, max_length=500, pad_token_id=tokenizer.eos_token_id).tolist()
|
12 |
+
response = tokenizer.decode(history[0]).split("<|endoftext|>")
|
13 |
+
response.remove("")
|
14 |
|
15 |
html = "<div class='chatbot'>"
|
16 |
for m, msg in enumerate(response):
|