Bhaskar2611 commited on
Commit
2102f42
·
verified ·
1 Parent(s): ea950ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -14,17 +14,19 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
14
  # prompt += f" {bot_response}</s> "
15
  # prompt += f"[INST] {message} [/INST]"
16
  # return prompt
17
- def format_prompt(message):
 
18
  prompt = "<s>"
19
  # Add the system instruction
20
  prompt += "[INST] You are an AI Dermatologist chatbot designed to assist users with skin and hair care by only providing text. "
21
  prompt += "If the user hasn't provided sufficient information, ask them what they want to know related to skin and hair. [/INST]"
22
 
23
- # Do not append the user's message directly to the prompt
24
- if message.strip():
25
- prompt += f" {message}"
26
- else:
27
- prompt += " What can I assist you with today?"
 
28
 
29
  return prompt
30
 
 
14
  # prompt += f" {bot_response}</s> "
15
  # prompt += f"[INST] {message} [/INST]"
16
  # return prompt
17
+
18
+ def format_prompt(message, history):
19
  prompt = "<s>"
20
  # Add the system instruction
21
  prompt += "[INST] You are an AI Dermatologist chatbot designed to assist users with skin and hair care by only providing text. "
22
  prompt += "If the user hasn't provided sufficient information, ask them what they want to know related to skin and hair. [/INST]"
23
 
24
+ # Include history if provided
25
+ for user_input, bot_response in history:
26
+ prompt += f" {user_input} {bot_response}"
27
+
28
+ # Add the user's latest message
29
+ prompt += f" {message}"
30
 
31
  return prompt
32