@celsowm's answer is extremely helpful. If you wish the continue the conversation like a chatbot (with history), you can do the following:
outputs = pipe(
chat_history,
max_new_tokens=512,
)
outputs[0]['generated_text'].append({"role": "user", "content": "Your chat message goes here"})# Appends one message from 'user'
outputs = pipe(
outputs,
max_new_tokens=512,
)# Generates ones response from 'assistant'
outputs[0]['generated_text'].append({"role": "user", "content": "Your chat message goes here"})# Appends one message from 'user'
outputs = pipe(
outputs,
max_new_tokens=512,
)# Generates ones response from 'assistant'
...