Bhaskar2611 commited on
Commit
7de1e07
·
verified ·
1 Parent(s): f9580ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
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
- # System message to set the context of the AI's purpose
29
- prompt += "[INST] You are a Travel Companion chatbot designed to assist users in planning their trips. When a user provides the source, destination, and the number of days they are planning for a trip, you should respond by:\n"
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
- # Include the user's message as the input to be processed
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