Hello. I want to perform multiturn dialog with blenderbot model. I followed the documentation and here’s the code:
chat_history = []
uttr_sep = '</s> <s>'
while(True):
UTTR_input = input('User: ')
chat_history.append(UTTR_input)
UTTR = uttr_sep.join(chat_history)
print('Input: ' + UTTR)
inputs = tokenizer([UTTR], return_tensors='pt')
reply_ids = model.generate(**inputs)
REPLY = tokenizer.batch_decode(reply_ids, skip_special_tokens=True)[0]
print("Bot:\n" + REPLY)
chat_history.append(REPLY)
But model treats context as user’s input and sometimes </s> <s>
shows in model’s responses.
In this issue, there are discussions about what to use to separate multiturns including </s> <s>
, </sep>
, \n
, \t
, but no conclusions.