From 55ae1b28c7260a8bdaf428ac4612a542668d471b Mon Sep 17 00:00:00 2001 From: Cristiano Ferreira Date: Mon, 26 Jun 2023 22:50:40 +0100 Subject: [PATCH] Update to always use role user as role system is useless pos. --- helper/api_messages.py | 12 ++++++------ sp1_playground.py | 4 ++-- sp2_playground.py | 8 ++++---- testing.py | 6 +++--- wt1_playground.py | 8 ++++---- wt2_playground.py | 8 ++++---- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/helper/api_messages.py b/helper/api_messages.py index 1e5f3a6..20575cd 100644 --- a/helper/api_messages.py +++ b/helper/api_messages.py @@ -10,11 +10,11 @@ def get_grading_messages(question_type: QuestionType, question: str, answer: str if QuestionType.WRITING_TASK_2 == question_type: return [ { - "role": "system", + "role": "user", "content": "You are a IELTS examiner.", }, { - "role": "system", + "role": "user", "content": f"The question you have to grade is of type Writing Task 2 and is the following: {question}", }, { @@ -89,11 +89,11 @@ def get_question_gen_messages(question_type: QuestionType): if QuestionType.WRITING_TASK_2 == question_type: return [ { - "role": "system", + "role": "user", "content": "You are a IELTS program that generates questions for the exams.", }, { - "role": "system", + "role": "user", "content": "The question you have to generate is of type Writing Task 2.", }, { @@ -116,11 +116,11 @@ def get_question_gen_messages(question_type: QuestionType): elif QuestionType.SPEAKING == question_type: return [ { - "role": "system", + "role": "user", "content": "You are a IELTS program that generates questions for the exams.", }, { - "role": "system", + "role": "user", "content": "The question you have to generate is of type Speaking Task.", }, { diff --git a/sp1_playground.py b/sp1_playground.py index 1c6d834..5e75ed7 100644 --- a/sp1_playground.py +++ b/sp1_playground.py @@ -30,11 +30,11 @@ def correct_answer( messages= [ { - "role": "system", + "role": "user", "content": "You are a IELTS examiner.", }, { - "role": "system", + "role": "user", "content": f"The question you have to grade is of type {question_type} and is the following: {question}", }, { diff --git a/sp2_playground.py b/sp2_playground.py index 7e1dd96..93ec8e4 100644 --- a/sp2_playground.py +++ b/sp2_playground.py @@ -24,22 +24,22 @@ def generate_summarizer( messages= [ { - "role": "system", + "role": "user", "content": "You are a IELTS examiner.", }, { - "role": "system", + "role": "user", "content": f"The question you have to grade is of type {question_type} and is the following: {question}", }, { - "role": "system", + "role": "user", "content": "Please provide a JSON object response with the overall grade and breakdown grades, " "formatted as follows: {'overall': 7.0, 'task_response': {'Task Achievement': 8.0, " "'Coherence and Cohesion': 6.5, 'Lexical Resource': 7.5, 'Grammatical Range and Accuracy': " "6.0}}", }, { - "role": "system", + "role": "user", "content": "Don't give explanations for the grades, just provide the json with the grades.", }, { diff --git a/testing.py b/testing.py index 078384c..144bb38 100644 --- a/testing.py +++ b/testing.py @@ -12,15 +12,15 @@ from helper.token_counter import count_tokens messages = [ { - "role": "system", + "role": "user", "content": "You are a IELTS examiner.", }, { - "role": "system", + "role": "user", "content": f"The question you have to grade is of type and is the following: ", }, { - "role": "system", + "role": "user", "content": "Please provide a JSON object response with the overall grade and breakdown grades, " "formatted as follows: {'overall': 7.0, 'task_response': {'Task Achievement': 8.0, " "'Coherence and Cohesion': 6.5, 'Lexical Resource': 7.5, 'Grammatical Range and Accuracy': " diff --git a/wt1_playground.py b/wt1_playground.py index 7e1dd96..93ec8e4 100644 --- a/wt1_playground.py +++ b/wt1_playground.py @@ -24,22 +24,22 @@ def generate_summarizer( messages= [ { - "role": "system", + "role": "user", "content": "You are a IELTS examiner.", }, { - "role": "system", + "role": "user", "content": f"The question you have to grade is of type {question_type} and is the following: {question}", }, { - "role": "system", + "role": "user", "content": "Please provide a JSON object response with the overall grade and breakdown grades, " "formatted as follows: {'overall': 7.0, 'task_response': {'Task Achievement': 8.0, " "'Coherence and Cohesion': 6.5, 'Lexical Resource': 7.5, 'Grammatical Range and Accuracy': " "6.0}}", }, { - "role": "system", + "role": "user", "content": "Don't give explanations for the grades, just provide the json with the grades.", }, { diff --git a/wt2_playground.py b/wt2_playground.py index f3b24cf..65e7640 100644 --- a/wt2_playground.py +++ b/wt2_playground.py @@ -24,22 +24,22 @@ def generate_summarizer( frequency_penalty=float(frequency_penalty), messages=[ { - "role": "system", + "role": "user", "content": "You are a IELTS examiner.", }, { - "role": "system", + "role": "user", "content": f"The question you have to grade is of type {question_type} and is the following: {question}", }, { - "role": "system", + "role": "user", "content": "Please provide a JSON object response with the overall grade and breakdown grades, " "formatted as follows: {'overall': 7.0, 'task_response': {'Task Achievement': 8.0, " "'Coherence and Cohesion': 6.5, 'Lexical Resource': 7.5, 'Grammatical Range and Accuracy': " "6.0}}", }, { - "role": "system", + "role": "user", "content": "Don't give explanations for the grades, just provide the json with the grades.", }, {