Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
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 |
|