bishmoy commited on
Commit
19f082d
1 Parent(s): 838a4fb

added dates in context

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -53,11 +53,12 @@ def rag_cleaner(inp):
53
  rank = inp['rank']
54
  title = inp['document_metadata']['title']
55
  content = inp['content']
56
- return f"{rank}. <b> {title} </b> \n Abstract: {content}"
 
57
 
58
  def get_prompt_text(question, context, formatted = True):
59
  if formatted:
60
- sys_instruction = f"Context:\n {context} \n Given the following scientific paper abstracts, take a deep breath and lets think step by step to answer what the question. Cite the titles of your sources when answering."
61
  message = f"Question: {question}"
62
  return f"<s>" + f"[INST] {sys_instruction} " + f" {message} [/INST] </s> "
63
  return f"Context:\n {context} \n Given the following info, take a deep breath and lets think step by step to answer the question: {question}. Cite the titles of your sources when answering.\n\n"
 
53
  rank = inp['rank']
54
  title = inp['document_metadata']['title']
55
  content = inp['content']
56
+ date = inp['document_metadata']['_time']
57
+ return f"{rank}. <b> {title} </b> \n Date : {date} \n Abstract: {content}"
58
 
59
  def get_prompt_text(question, context, formatted = True):
60
  if formatted:
61
+ sys_instruction = f"Context:\n {context} \n Given the following scientific paper abstracts, take a deep breath and lets think step by step to answer the question. Cite the titles of your sources when answering, do not cite links or dates."
62
  message = f"Question: {question}"
63
  return f"<s>" + f"[INST] {sys_instruction} " + f" {message} [/INST] </s> "
64
  return f"Context:\n {context} \n Given the following info, take a deep breath and lets think step by step to answer the question: {question}. Cite the titles of your sources when answering.\n\n"