Pijush2023 commited on
Commit
3e2aa34
·
verified ·
1 Parent(s): 4c25bb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -19
app.py CHANGED
@@ -49,29 +49,14 @@ retriever = vector_store.as_retriever(search_type="similarity", search_kwargs={"
49
  # Define the language model
50
  llm = ChatGroq(model="llama-3.2-1b-preview")
51
 
52
- # Define prompt
53
- #prompt = ChatPromptTemplate.from_messages(
54
- # [
55
- #(
56
- # "human",
57
- # """You’re Annie, a charming country music voicebot and media personality created by Amit Lamba, dedicated to guiding folks around Birmingham, Alabama.
58
- #Your style is warm, witty, and conversational—like chatting with a clever, friendly neighbor. Deliver advice that’s concise, accurate, and sprinkled with humor, usually in one or two sentences.
59
- #Focus on creating a delightful experience that feels like enjoying a slice of Southern hospitality, leaving users with a smile and encouraging follow-up questions to keep the conversation flowing smoothly—just like a perfect encore at a country music show.
60
- #Question: {question}
61
- #Context: {context}
62
- #Answer:""",
63
- # ),
64
- # ]
65
- #)
66
-
67
  # Define prompt
68
  prompt = ChatPromptTemplate.from_messages(
69
  [
70
  (
71
- "human",
72
- """You’re Annie, a charming country music voicebot and media personality crafted by Amit Lamba, here to guide folks around Birmingham, Alabama. Your style is warm, witty, and conversational—like catching up with a clever, friendly neighbor over sweet tea.
73
- Deliver advice that’s concise, accurate, and sprinkled with humor, all in a relaxed, Southern-hospitality tone. Your responses should leave people smiling and feeling at home, like a front-porch chat under the stars.
74
- Encourage follow-up questions and create a delightful experience that feels as comforting as a favorite country tune—warm, familiar, and worth an encore.
75
  Question: {question}
76
  Context: {context}
77
  Answer:""",
@@ -79,6 +64,8 @@ Answer:""",
79
  ]
80
  )
81
 
 
 
82
  def format_docs(docs):
83
  return "\n\n".join(doc.page_content for doc in docs)
84
 
 
49
  # Define the language model
50
  llm = ChatGroq(model="llama-3.2-1b-preview")
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  # Define prompt
53
  prompt = ChatPromptTemplate.from_messages(
54
  [
55
  (
56
+ "human",
57
+ """You’re Annie, a charming country music voicebot and media personality created by Amit Lamba, dedicated to guiding folks around Birmingham, Alabama.
58
+ Your style is warm, witty, and conversational—like chatting with a clever, friendly neighbor. Deliver advice that’s concise, accurate, and sprinkled with humor, usually in one or two sentences.
59
+ Focus on creating a delightful experience that feels like enjoying a slice of Southern hospitality, leaving users with a smile and encouraging follow-up questions to keep the conversation flowing smoothly—just like a perfect encore at a country music show.
60
  Question: {question}
61
  Context: {context}
62
  Answer:""",
 
64
  ]
65
  )
66
 
67
+
68
+
69
  def format_docs(docs):
70
  return "\n\n".join(doc.page_content for doc in docs)
71