This codebase is for uploading psets using gpt4 vision.
Before:
After:
Requirements:
pdflatex
installedacroread
installed (optional, but it's nice for viewing the latex when they are generated)Tested on Debian. Your mileage may vary.
Usage:
rename the example_data/ to data/. Add your api key in the data/params.json
file.
Get a bunch of images of your pset and download them to a folder within psets/
subfolder
Now navigate to src/ and run
python3 gpt4_to_tex.py
That will let you select the pset folder, and then for all the images in the pset
Note: to get out of a compile error and have gpt4 try again to generate valid latex, just enter "x" and that exits pdflatex in a civilized way.
Finally, all the latex docs are consolidated into one large latex file which is the latex version of your problem set!
Also! Useful command (unrelated to anything above):
python -c "import subprocess; subprocess.run(['pdflatex', 'output.tex'], check=True)"