Spaces:
Running
on
Zero
Running
on
Zero
jedick
commited on
Commit
·
c3715f2
1
Parent(s):
7e18a82
Don't use answer_with_citations() for local models
Browse files
graph.py
CHANGED
|
@@ -132,7 +132,7 @@ def BuildGraph(
|
|
| 132 |
top_k=6,
|
| 133 |
think_query=False,
|
| 134 |
think_answer=False,
|
| 135 |
-
local_citations=
|
| 136 |
embedding_ckpt_dir=None,
|
| 137 |
):
|
| 138 |
"""
|
|
@@ -258,7 +258,7 @@ def BuildGraph(
|
|
| 258 |
if is_local:
|
| 259 |
# Don't include the system message here because it's defined in ToolCallingLLM
|
| 260 |
messages = state["messages"]
|
| 261 |
-
messages = normalize_messages(messages
|
| 262 |
else:
|
| 263 |
messages = [SystemMessage(query_prompt(chat_model))] + state["messages"]
|
| 264 |
response = query_model.invoke(messages)
|
|
@@ -269,7 +269,7 @@ def BuildGraph(
|
|
| 269 |
"""Generates an answer with the chat model"""
|
| 270 |
if is_local:
|
| 271 |
messages = state["messages"]
|
| 272 |
-
messages = normalize_messages(messages
|
| 273 |
if not local_citations:
|
| 274 |
# Add the system message here if we're not using tools
|
| 275 |
messages = [
|
|
|
|
| 132 |
top_k=6,
|
| 133 |
think_query=False,
|
| 134 |
think_answer=False,
|
| 135 |
+
local_citations=False,
|
| 136 |
embedding_ckpt_dir=None,
|
| 137 |
):
|
| 138 |
"""
|
|
|
|
| 258 |
if is_local:
|
| 259 |
# Don't include the system message here because it's defined in ToolCallingLLM
|
| 260 |
messages = state["messages"]
|
| 261 |
+
messages = normalize_messages(messages)
|
| 262 |
else:
|
| 263 |
messages = [SystemMessage(query_prompt(chat_model))] + state["messages"]
|
| 264 |
response = query_model.invoke(messages)
|
|
|
|
| 269 |
"""Generates an answer with the chat model"""
|
| 270 |
if is_local:
|
| 271 |
messages = state["messages"]
|
| 272 |
+
messages = normalize_messages(messages)
|
| 273 |
if not local_citations:
|
| 274 |
# Add the system message here if we're not using tools
|
| 275 |
messages = [
|