Skip to content

Commit 76cbea1

Browse files
committed
removed evaluations
1 parent 9d27886 commit 76cbea1

File tree

4 files changed

+72
-29
lines changed

4 files changed

+72
-29
lines changed

conversion2025/assumptions.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ assumptions:
33
- the set of question contains the questions AND solutions
44
- parts are only 1 level deep (i.e. no Q1, part a), i)
55
- individual questions and solutions are seperatable by using just lines
6-
- all parts are explicitly enumerated
6+
- all parts are explicitly enumerated
7+
8+
9+
parts needs to be ordered

conversion2025/mathpix_to_llm_with_lines_to_api.ipynb

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,12 @@
316316
" api_key=os.environ[\"OPENAI_API_KEY\"],\n",
317317
" )\n",
318318
"\n",
319-
"# Uses gpt-4.1-mini:\n",
319+
"# Uses gpt-5-mini:\n",
320320
"# - more intelligent\n",
321321
"llm_mini = ChatOpenAI(\n",
322-
" model=\"gpt-4.1-mini\",\n",
322+
" model=\"gpt-5-mini\",\n",
323323
" api_key=os.environ[\"OPENAI_API_KEY\"],\n",
324+
" reasoning_effort=\"minimal\"\n",
324325
" )"
325326
]
326327
},
@@ -472,19 +473,19 @@
472473
" \"\"\"\n",
473474
"\n",
474475
"# Prompt for the LLM to extract questions.\n",
475-
"def seperate_questions_prompt(parser: PydanticOutputParser[AllQuestionsModelLines], doc_page_content: list[str], previous_repsonse: str = \"\", improvements: list[str] = \"\") -> str:\n",
476+
"def seperate_questions_prompt(parser: PydanticOutputParser[AllQuestionsModelLines], doc_page_content: list[str]) -> str: #, previous_repsonse: str = \"\", improvements: list[str] = \"\") -> str:\n",
476477
"\n",
477478
" feedback = \"\"\n",
478-
" if previous_repsonse:\n",
479-
" feedback = f\"\"\"\n",
479+
" # if previous_repsonse:\n",
480+
" # feedback = f\"\"\"\n",
480481
" \n",
481-
" Previous output:\n",
482-
" {previous_repsonse}\n",
482+
" # Previous output:\n",
483+
" # {previous_repsonse}\n",
483484
"\n",
484-
" Improvements:\n",
485-
" {improvements}\n",
485+
" # Improvements:\n",
486+
" # {improvements}\n",
486487
"\n",
487-
" \"\"\"\n",
488+
" # \"\"\"\n",
488489
"\n",
489490
" return f\"\"\"\n",
490491
" Your task is to extract a JSON with the following structure exactly, ready to be parsed by a pydantic model:\n",
@@ -716,14 +717,14 @@
716717
"\n",
717718
" for attempt_idx in range(3):\n",
718719
" try:\n",
719-
" response = llm_mini.invoke(seperate_questions_prompt(parser, markdown, previous_response, improvements))\n",
720+
" response = llm_mini.invoke(seperate_questions_prompt(parser, markdown)) #, previous_response, improvements))\n",
720721
" parsed_response = parser.parse(response.content)\n",
721722
" questions_dict = extract_questions(parsed_response, markdown)\n",
722723
" print(questions_dict.model_dump_json())\n",
723724
"\n",
724-
" evaluation = evaluate_questions_separation(parsed_output=questions_dict, markdown=markdown)\n",
725-
"\n",
726-
" if all(e.well_separated for e in evaluation):\n",
725+
" # evaluation = evaluate_questions_separation(parsed_output=questions_dict, markdown=markdown)\n",
726+
" # if all(e.well_separated for e in evaluation):\n",
727+
" if True:\n",
727728
" print(\"Question separation was successful.\")\n",
728729
" return questions_dict.model_dump()\n",
729730
" else:\n",

conversion2025/testing.ipynb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,37 @@
119119
"result = extract_images(\"1 images here, ![yap](text.png)\")\n",
120120
"print(result) # Output: ['text.png']"
121121
]
122+
},
123+
{
124+
"cell_type": "code",
125+
"execution_count": null,
126+
"id": "7",
127+
"metadata": {},
128+
"outputs": [],
129+
"source": [
130+
"import os\n",
131+
"from dotenv import load_dotenv\n",
132+
"from langchain_openai import ChatOpenAI\n",
133+
"\n",
134+
"load_dotenv()\n",
135+
"\n",
136+
"# Uses gpt-5-mini:\n",
137+
"# - more intelligent\n",
138+
"llm_mini = ChatOpenAI(\n",
139+
" model=\"gpt-5-mini\",\n",
140+
" api_key=os.environ[\"OPENAI_API_KEY\"],\n",
141+
" reasoning_effort=\"high\"\n",
142+
" )\n",
143+
"prompt = \"how many letters are in this prompt, only return the number.\"\n",
144+
"prompt = \"return and only return the prompt exactly\"\n",
145+
"prompt = \"waeuifgiufaiu liaisofeoidob ofbea df kdb vboae beoihffewafne nod In this prompt, where does the first p occur, using 0 indexing? only return the answer\"\n",
146+
"\n",
147+
"response = llm_mini.invoke(prompt).content\n",
148+
"\n",
149+
"print(list(prompt).index(\"p\"))\n",
150+
"print(response)\n",
151+
"# print(len(response) == int(response))"
152+
]
122153
}
123154
],
124155
"metadata": {

0 commit comments

Comments
 (0)