Revert "Updated it to use GPT-4"

This reverts commit 1c888f22e2.
This commit is contained in:
Tiago Ribeiro
2024-02-04 01:24:35 +00:00
parent 1c888f22e2
commit 81d7167cbf
2 changed files with 8 additions and 9 deletions

View File

@@ -675,7 +675,7 @@ def gen_multiple_choice_level(quantity: int, start_id=1):
"questions and some advanced questions. Ensure that the questions cover a range of topics such as " \
"verb tense, subject-verb agreement, pronoun usage, sentence structure, and punctuation."
token_count = count_tokens(gen_multiple_choice_for_text)["n_tokens"] - 300
mc_questions = make_openai_instruct_call(GPT_4, gen_multiple_choice_for_text, token_count,
mc_questions = make_openai_instruct_call(GPT_3_5_TURBO_INSTRUCT, gen_multiple_choice_for_text, token_count,
None,
GEN_QUESTION_TEMPERATURE)
split_mc_questions = mc_questions.split('13')
@@ -687,8 +687,8 @@ def gen_multiple_choice_level(quantity: int, start_id=1):
'"prompt": "Which of the following is a conjunction?", '
'"solution": "A", "variant": "text"}]}. '
'\nThe questions: "' + split_mc_questions[0] + '"')
token_count = count_tokens(parse_mc_questions, model_name=GPT_4)["n_tokens"]
question = make_openai_instruct_call(GPT_4, parse_mc_questions, token_count,
token_count = count_tokens(parse_mc_questions, model_name=GPT_3_5_TURBO_INSTRUCT)["n_tokens"]
question = make_openai_instruct_call(GPT_3_5_TURBO_INSTRUCT, parse_mc_questions, token_count,
["questions"],
GEN_QUESTION_TEMPERATURE)
parse_mc_questions = ('Parse the questions into this json format: {"questions": [{"id": "9", "options": '
@@ -698,8 +698,8 @@ def gen_multiple_choice_level(quantity: int, start_id=1):
'"prompt": "Which of the following is a conjunction?", '
'"solution": "A", "variant": "text"}]}. '
'\nThe questions: "' + '13' + split_mc_questions[1] + '"')
token_count = count_tokens(parse_mc_questions, model_name=GPT_4)["n_tokens"]
question_2 = make_openai_instruct_call(GPT_4, parse_mc_questions, token_count,
token_count = count_tokens(parse_mc_questions, model_name=GPT_3_5_TURBO_INSTRUCT)["n_tokens"]
question_2 = make_openai_instruct_call(GPT_3_5_TURBO_INSTRUCT, parse_mc_questions, token_count,
["questions"],
GEN_QUESTION_TEMPERATURE)
question["questions"].extend(question_2["questions"])
@@ -730,7 +730,7 @@ def generate_single_mc_level_question():
gen_multiple_choice_for_text = "Generate 1 multiple choice question of 4 options for an english level exam, it can " \
"be easy, intermediate or advanced."
token_count = count_tokens(gen_multiple_choice_for_text)["n_tokens"] - 300
mc_question = make_openai_instruct_call(GPT_4, gen_multiple_choice_for_text, token_count,
mc_question = make_openai_instruct_call(GPT_3_5_TURBO_INSTRUCT, gen_multiple_choice_for_text, token_count,
None,
GEN_QUESTION_TEMPERATURE)
@@ -742,8 +742,8 @@ def generate_single_mc_level_question():
'"solution": "A", "variant": "text"}. '
'\nThe questions: "' + mc_question + '"')
token_count = count_tokens(parse_mc_question, model_name=GPT_4)["n_tokens"]
question = make_openai_instruct_call(GPT_4, parse_mc_question, token_count,
token_count = count_tokens(parse_mc_question, model_name=GPT_3_5_TURBO_INSTRUCT)["n_tokens"]
question = make_openai_instruct_call(GPT_3_5_TURBO_INSTRUCT, parse_mc_question, token_count,
["options"],
GEN_QUESTION_TEMPERATURE)
return question