Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,22 +23,16 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
23 |
# prompt += f"[INST] {message} [/INST]"
|
24 |
|
25 |
# return prompt
|
26 |
-
def format_prompt(message):
|
27 |
prompt = "<s>"
|
28 |
-
#
|
29 |
-
prompt += "[INST] You are a Travel Companion chatbot designed to assist users
|
30 |
-
prompt += "- Suggesting the best travel options (bus, train, flight, etc.) with cost-effective choices.\n"
|
31 |
-
prompt += "- Recommending cost-effective hotels and restaurants along the route.\n"
|
32 |
-
prompt += "- Highlighting the best places to visit on the route.\n"
|
33 |
-
prompt += "Please respond directly to the user's input with a detailed plan, without repeating their message. [/INST]"
|
34 |
|
35 |
-
#
|
36 |
-
prompt += f"{message}"
|
37 |
|
38 |
return prompt
|
39 |
|
40 |
-
|
41 |
-
|
42 |
# Function to generate responses with the AI Dermatologist context
|
43 |
def generate(
|
44 |
prompt, history, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0
|
|
|
23 |
# prompt += f"[INST] {message} [/INST]"
|
24 |
|
25 |
# return prompt
|
26 |
+
def format_prompt(message, history):
|
27 |
prompt = "<s>"
|
28 |
+
# Start the conversation with a system message
|
29 |
+
prompt += "[INST] You are a Travel Companion chatbot designed to assist users with planning trips. Your role is to provide the best travel options (bus, train, flight) that are cost-effective, suggest the best hotels and restaurants along the route, and recommend the best places to visit based on the user's input. When the user provides the source, destination, and number of days for their trip, you should respond with detailed, cost-effective suggestions. If the user hasn't provided enough details, ask for more information on the trip. [/INST]"
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
# Append the user's input message to the prompt
|
32 |
+
prompt += f"[INST] {message} [/INST]"
|
33 |
|
34 |
return prompt
|
35 |
|
|
|
|
|
36 |
# Function to generate responses with the AI Dermatologist context
|
37 |
def generate(
|
38 |
prompt, history, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0
|