Spaces:
Running
Running
added dates in context
Browse files
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 |
-
|
|
|
|
| 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
|
| 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"
|