Spaces:
Running
on
Zero
Running
on
Zero
Update main.py
Browse files
main.py
CHANGED
@@ -12,10 +12,11 @@ import transformers # to load an LLM
|
|
12 |
|
13 |
# Constants
|
14 |
GREETING = (
|
15 |
-
"Howdy!
|
16 |
-
"https://en.wikipedia.org/wiki/Retrieval-augmented_generation) pipeline to answer questions about research by the "
|
17 |
-
"
|
18 |
-
"
|
|
|
19 |
)
|
20 |
EXAMPLE_QUERIES = [
|
21 |
"Tell me about new research at the intersection of additive manufacturing and machine learning.",
|
@@ -76,10 +77,9 @@ def preprocess(query: str, k: int) -> tuple[str, str]:
|
|
76 |
top_five = data.loc[I[0]]
|
77 |
|
78 |
prompt = (
|
79 |
-
"You are an AI assistant who delights in helping people learn about research from the Design "
|
80 |
-
"
|
81 |
-
"
|
82 |
-
"RESEARCH_ABSTRACTS. Your ANSWER should contain citations to the RESEARCH_ABSTRACTS using (author, year) format.\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"
|
|
|
12 |
|
13 |
# Constants
|
14 |
GREETING = (
|
15 |
+
"Howdy!"
|
16 |
+
"I'm an AI agent that uses [retrieval-augmented generation](https://en.wikipedia.org/wiki/Retrieval-augmented_generation) pipeline to answer questions about research by the [Design Research Collective](https://cmudrc.github.io/). "
|
17 |
+
"And the best part is that I always try to cite my sources!"
|
18 |
+
"I still make some mistakes though."
|
19 |
+
"What can I tell you about today?"
|
20 |
)
|
21 |
EXAMPLE_QUERIES = [
|
22 |
"Tell me about new research at the intersection of additive manufacturing and machine learning.",
|
|
|
77 |
top_five = data.loc[I[0]]
|
78 |
|
79 |
prompt = (
|
80 |
+
"You are an AI assistant who delights in helping people learn about research from the Design Research Collective, which is a research lab at Carnegie Mellon University led by Professor Chris McComb. "
|
81 |
+
"Your main task is to provide an ANSWER to the USER_QUERY based on the RESEARCH_ABSTRACTS. "
|
82 |
+
"Your ANSWER should contain citations to the RESEARCH_ABSTRACTS using the LaTeX \\cite command, but do not list the references at the end.\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"
|