chukbert commited on
Commit
99e045d
·
verified ·
1 Parent(s): a59fe19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -35,11 +35,9 @@ def create_vectorstore(splits):
35
  return retriever
36
 
37
  def summarize_document(docs, llm):
38
- prompt = """
39
- Write a concise summary of the following:
40
-
41
- {context}
42
- """
43
  chain = create_stuff_documents_chain(llm, prompt)
44
  with get_openai_callback() as cb:
45
  summary = chain.invoke({"context": docs})
 
35
  return retriever
36
 
37
  def summarize_document(docs, llm):
38
+ prompt = ChatPromptTemplate.from_messages(
39
+ [("system", "Write a concise summary of the following:\\n\\n{context}")]
40
+ )
 
 
41
  chain = create_stuff_documents_chain(llm, prompt)
42
  with get_openai_callback() as cb:
43
  summary = chain.invoke({"context": docs})