Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,7 @@ llm = ChatPerplexity(temperature=0, pplx_api_key=GROQ_API_KEY, model="llama-3.1-
|
|
105 |
# )
|
106 |
|
107 |
# Contextualization prompt and retriever
|
108 |
-
contextualize_q_system_prompt = """Given a chat history and the latest user question \
|
109 |
which might reference context in the chat history, formulate a standalone question \
|
110 |
which can be understood without the chat history. Do NOT answer the question, \
|
111 |
just reformulate it if needed and otherwise return it as is.
|
@@ -139,7 +139,7 @@ When responding to queries, follow these guidelines:
|
|
139 |
|
140 |
3. Proper Citations:
|
141 |
- ALWAYS USE INLINE CITATIONS WITH EMBEDDED SOURCE URLs WHERE USERS CAN VERIFY INFORMATION OR EXPLORE FURTHER.
|
142 |
-
- THE INLINE CITATIONS SHOULD BE IN THE FORMAT [1], [2], etc.
|
143 |
- DO NOT INCLUDE the 'References' section in the response.
|
144 |
|
145 |
FOLLOW ALL THE GIVEN INSTRUCTIONS, FAILURE TO DO SO WILL RESULT IN THE TERMINATION OF THE CHAT.
|
@@ -214,6 +214,7 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
214 |
complete_response += chunk['answer']
|
215 |
await websocket.send_json({'response': chunk['answer']})
|
216 |
|
|
|
217 |
if context:
|
218 |
citations = re.findall(r'\[(\d+)\]', complete_response)
|
219 |
citation_numbers = list(map(int, citations))
|
|
|
105 |
# )
|
106 |
|
107 |
# Contextualization prompt and retriever
|
108 |
+
contextualize_q_system_prompt = """ Given a chat history and the latest user question \
|
109 |
which might reference context in the chat history, formulate a standalone question \
|
110 |
which can be understood without the chat history. Do NOT answer the question, \
|
111 |
just reformulate it if needed and otherwise return it as is.
|
|
|
139 |
|
140 |
3. Proper Citations:
|
141 |
- ALWAYS USE INLINE CITATIONS WITH EMBEDDED SOURCE URLs WHERE USERS CAN VERIFY INFORMATION OR EXPLORE FURTHER.
|
142 |
+
- THE INLINE CITATIONS SHOULD BE IN THE FORMAT [1], [2], etc.
|
143 |
- DO NOT INCLUDE the 'References' section in the response.
|
144 |
|
145 |
FOLLOW ALL THE GIVEN INSTRUCTIONS, FAILURE TO DO SO WILL RESULT IN THE TERMINATION OF THE CHAT.
|
|
|
214 |
complete_response += chunk['answer']
|
215 |
await websocket.send_json({'response': chunk['answer']})
|
216 |
|
217 |
+
print(complete_response)
|
218 |
if context:
|
219 |
citations = re.findall(r'\[(\d+)\]', complete_response)
|
220 |
citation_numbers = list(map(int, citations))
|