Skip to content

Commit

Permalink
fixing llama_rag demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Oct 27, 2024
1 parent fca5864 commit 4facfa5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions llama_demos/llama_demos/llama_rag_demo_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
[
SystemMessage("You are an AI assistant that answer questions."),
HumanMessagePromptTemplate.from_template(
"Taking into account the followin context:\n{context}\nAnswer this question: {question}"
"Taking into account the followin context:{context}\n\nAnswer this question: {question}"
),
]
)
Expand All @@ -74,7 +74,12 @@


def format_docs(docs):
return "\n\n\t- ".join(doc.page_content for doc in docs)
formated_docs = ""

for d in docs:
formated_docs += f"\n\n\t- {d.page_content}"

return formated_docs


# create and use the chain
Expand Down

0 comments on commit 4facfa5

Please sign in to comment.