Closed simonw closed 5 months ago
Got Claude 3 Opus to figure it out for me:
curl 'https://tools.simonwillison.net/ocr' | llm -m opus --system '
rewrite this code so when the select box for language is changed the OCR
is re-run against any images currently visible on the page, replacing the text
in their textareas and updating the full document textarea at the top if it is present'
Transcript: https://gist.github.com/simonw/0de241c6adb86808b27841319f0d82b5
It's not perfect: the code doesn't disable the file upload widget or show a page counter while it re-runs OCR, unlike when it runs for the first time. I don't want to spend any more time on this though.
Switching language before you have selected a file should not do this:
Otherwise it goes wrong, but it doesn't give you any feedback to help you spot why it broke.
https://twitter.com/iYousif/status/1774595239182745654