try: result = json.loads(response) except json.JSONDecodeError: # TODO: God forgive me... import openai ...

Jan 14, 2023 · 2:39 AM UTC

Replying to @goodside
Been using XML after hella headaches with JSON parsing bc my outputs sometimes had new lines
XML has its own escaping issues with angle brackets and ampersands if the document is complex or looks XML-ish enough to it. I wrote it off because of that but maybe I should try it more.
Replying to @goodside
This is so cool. Wonder if GPT can summarize a complex regex
Search my timeline — I've done a lot of examples of those, and they should all work better now since they were done in the text‑davinci‑002 era.
Replying to @goodside
I've thought about creating a fine-tuned Curie model specifically trained to fix buggy JSON.
Me too — I'd synthesize the tuning examples using k-shots in code‑davinci‑002. Seems like it would work.
Replying to @goodside
cool, so, instead of flagging errors that could be fixed at the source, I can have my corrupt data be silently replaced by potentially hallucinated data. me likes
Yes, but that’s a problem for the next dev.
Replying to @goodside
Someone should fine tune a model for this, distill down the weights, host on a public endpoint and provide core infra for us all