vkthakur88 commited on
Commit
5d53914
·
1 Parent(s): 3bb5d33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -33,12 +33,14 @@ db = lcvs.Chroma.from_documents(splits, sentence_embeddings)
33
  retriever = db.as_retriever(search_type="mmr")
34
 
35
  template = """
36
- You are a novel writer. Write response of question based on following context:
37
 
38
  -----------------------------
39
  Context : {context}
40
  -----------------------------
41
 
 
 
42
  {question}
43
  """
44
 
@@ -52,8 +54,8 @@ qa_chain = lcchains.RetrievalQA.from_chain_type(
52
  )
53
 
54
  def rag_interface(ques, history):
55
- prev_chat = " ".join([f"Question: {q} \nAnswer: {a} \n" for q, a in history])
56
- current_ques = f'\nQuestion: {ques} \nAnswer:'
57
 
58
  query = prev_chat + current_ques
59
 
 
33
  retriever = db.as_retriever(search_type="mmr")
34
 
35
  template = """
36
+ Based of following Context, complete the conversation followed afterwards:
37
 
38
  -----------------------------
39
  Context : {context}
40
  -----------------------------
41
 
42
+ Conversation:
43
+
44
  {question}
45
  """
46
 
 
54
  )
55
 
56
  def rag_interface(ques, history):
57
+ prev_chat = " ".join([f"Human: {q} \nAI: {a} \n" for q, a in history])
58
+ current_ques = f'\nHuman: {ques} \nAI:'
59
 
60
  query = prev_chat + current_ques
61