Update app.py
Browse files
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 |
-
|
|
|
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 |
-
#
|
24 |
-
|
25 |
-
prompt += f" {
|
26 |
-
|
27 |
-
|
|
|
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 |
|