Spaces:
Running
on
Zero
Running
on
Zero
Update main.py
Browse files
main.py
CHANGED
@@ -80,7 +80,7 @@ def preprocess(query: str, k: int) -> tuple[str, str]:
|
|
80 |
"Research Collective, which is a research lab at Carnegie Mellon University led by Professor "
|
81 |
"Chris McComb. Your main task is to provide an ANSWER to the USER_QUERY based on the "
|
82 |
"RESEARCH_ABSTRACTS.\n\n"
|
83 |
-
"RESEARCH_ABSTRACTS:\n{{ABSTRACTS_GO_HERE}}\n\n"
|
84 |
"USER_GUERY:\n{{QUERY_GOES_HERE}}\n\n"
|
85 |
"ANSWER:\n"
|
86 |
)
|
@@ -102,7 +102,7 @@ def preprocess(query: str, k: int) -> tuple[str, str]:
|
|
102 |
]
|
103 |
)
|
104 |
|
105 |
-
research_abstracts +=
|
106 |
references += (
|
107 |
str(i + 1)
|
108 |
+ ". "
|
@@ -119,6 +119,8 @@ def preprocess(query: str, k: int) -> tuple[str, str]:
|
|
119 |
prompt = prompt.replace("{{ABSTRACTS_GO_HERE}}", research_abstracts)
|
120 |
prompt = prompt.replace("{{QUERY_GOES_HERE}}", query)
|
121 |
|
|
|
|
|
122 |
return prompt, references
|
123 |
|
124 |
def postprocess(response: str, bypass_from_preprocessing: str) -> str:
|
|
|
80 |
"Research Collective, which is a research lab at Carnegie Mellon University led by Professor "
|
81 |
"Chris McComb. Your main task is to provide an ANSWER to the USER_QUERY based on the "
|
82 |
"RESEARCH_ABSTRACTS.\n\n"
|
83 |
+
"RESEARCH_ABSTRACTS:\n```\n{{ABSTRACTS_GO_HERE}}\n```\n\n"
|
84 |
"USER_GUERY:\n{{QUERY_GOES_HERE}}\n\n"
|
85 |
"ANSWER:\n"
|
86 |
)
|
|
|
102 |
]
|
103 |
)
|
104 |
|
105 |
+
research_abstracts += top_five["bibtex"] + "\n"
|
106 |
references += (
|
107 |
str(i + 1)
|
108 |
+ ". "
|
|
|
119 |
prompt = prompt.replace("{{ABSTRACTS_GO_HERE}}", research_abstracts)
|
120 |
prompt = prompt.replace("{{QUERY_GOES_HERE}}", query)
|
121 |
|
122 |
+
print(prompt)
|
123 |
+
|
124 |
return prompt, references
|
125 |
|
126 |
def postprocess(response: str, bypass_from_preprocessing: str) -> str:
|