zakiyahfarooque commited on
Commit
b245447
·
verified ·
1 Parent(s): e0921bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -12,7 +12,7 @@ def chatbot_response(user_input, chat_history=[]):
12
  # Format chat history
13
  history_text = " ".join([f"User: {msg[0]} Assistant: {msg[1]}" for msg in chat_history])
14
 
15
- formatted_input = f"{history_text} User: {user_input} Assistant:"
16
  inputs = tokenizer(formatted_input, return_tensors="pt")
17
  reply_ids = model.generate(**inputs, max_length=100)
18
  response = tokenizer.decode(reply_ids[0], skip_special_tokens=True)
 
12
  # Format chat history
13
  history_text = " ".join([f"User: {msg[0]} Assistant: {msg[1]}" for msg in chat_history])
14
 
15
+ formatted_input = f"You are a helpful assistant. The user says: {user_input}"
16
  inputs = tokenizer(formatted_input, return_tensors="pt")
17
  reply_ids = model.generate(**inputs, max_length=100)
18
  response = tokenizer.decode(reply_ids[0], skip_special_tokens=True)