Sugamdeol commited on
Commit
a0876f1
1 Parent(s): 1ed4c00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -6,11 +6,10 @@ client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
6
 
7
  # Function to format the conversation history
8
  def format_prompt(message, history):
9
- prompt = "<s>" # Begin with the start token
10
  for user_prompt, bot_response in history:
11
- # Append each turn of user-bot interaction to the prompt
12
- prompt += f"[INST] {user_prompt} [/INST] {bot_response}</s> "
13
- prompt += f"[INST] {message} [/INST]" # Add the latest user message
14
  return prompt
15
 
16
  # Text generation function with parameters
 
6
 
7
  # Function to format the conversation history
8
  def format_prompt(message, history):
9
+ prompt = "<s>"
10
  for user_prompt, bot_response in history:
11
+ prompt += f"[INST] {user_prompt} [/INST] {bot_response} "
12
+ prompt += f"[INST] {message} [/INST]</s>"
 
13
  return prompt
14
 
15
  # Text generation function with parameters