Spaces:
Paused
Paused
Update app.py
Browse files15 unmodified lines16171819202119202122235 unmodified lines29303133343233343515 unmodified lines
def respond(message, history): messages = [{"role": "system", "content": "You are Spartacus, a helpful assistant."}] for user_msg, bot_msg in history: messages.append({"role": "user", "content": user_msg}) messages.append({"role": "assistant", "content": bot_msg}) for msg in history: messages.append({"role": msg["role"], "content": msg["content"]}) messages.append({"role": "user", "content": message})
input_ids = tokenizer.apply_chat_template(5 unmodified lines generate_kwargs = dict( input_ids=input_ids, streamer=streamer, max_new_tokens=1024, temperature=0.7, temperature=0.5, top_p=0.9, do_sample=True, )app.py+3-5