Skip to content
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

fixing spelling #110

Merged
merged 2 commits into from
Aug 1, 2023
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
10 changes: 5 additions & 5 deletions openvalidators/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def find_unique_tags(input_text: str):


# Request a follow-up question given a preceding context.
followup_request_template = "Ask one relevant and insightful question about the preceding context"
followup_request_template = "Ask a single relevant and insightful question about the preceding context"

# Scores a summary on a scale from 0 to 10, given a context.
augment_scoring_template = """Score the relevance, succinctness, and quality of a summary given a context. The context is within <Context></Context> tags, and the question is within <Summary></Summary> tags. Give a score between 0 and 10 in the <Score></Score> tags, where 0 means the summary is irrelevant, and 10 means it's perfectly relevant and a good summary. Include a brief explanation for your score based solely on the context-summary relationship.
Expand Down Expand Up @@ -348,16 +348,16 @@ def find_unique_tags(input_text: str):

def followup_prompt( base_text:str, i:int = 0) -> str:
if i == 0:
return f"{base_text}\n\n{followup_request_template}\n"
return f"{base_text}\n\n{followup_request_template}. Do not return an answer:\n"
else:
return f"{base_text}\n\n{followup_request_template} and previous questions\n"
return f"{base_text}\n\n{followup_request_template} and previous questions. Do not return an answer:\n"


def answer_prompt( base_text:str, followup:str ) -> str:
return f"{base_text}\n Question:{followup}\n Answer the question step by step and explain your thoughts"
return f"{base_text}\n\nQuestion: {followup}\nAnswer the last question step by step and explain your thoughts:\n"

augment_request_template = "Summarize the preceding context"

def augment_prompt( base_text:str ) -> str:
random_level = random.randint(4, 8)
return f"{base_text}\n\n{augment_request_template} in {random_level} sentences.\n\n"
return f"{base_text}\n\n{augment_request_template} in {random_level} sentences.\n"