Skip to content

[RAFT] Edit encode prompt to include <ANSWER>: tag in label #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion raft/raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def encode_question_gen(question: str, chunk: Any) -> list[str]:
- First provide step-by-step reasoning on how to answer the question.
- In the reasoning, if you need to copy paste some sentences from the context, include them in ##begin_quote## and ##end_quote##. This would mean that things outside of ##begin_quote## and ##end_quote## are not directly copy paste from the context.
- End your response with final answer in the form <ANSWER>: $answer, the answer should be succinct.
You MUST begin your final answer with the tag "<ANSWER>:".
""".format(question=question, context=str(chunk))
prompts.append({"role": "system", "content": "You are a helpful question answerer who can provide an answer given a question and relevant context."})
prompts.append({"role": "user", "content": prompt})
Expand Down Expand Up @@ -375,4 +376,4 @@ def main():

if __name__ == "__main__":
with MDC(progress="0%"):
main()
main()