fix_and_load_json drops a comma that is inside a string
Author: SashaMITCreated Sep 28, 2026Updated Sep 28, 2026
fix_and_load_json('{"note": "use 1,}"}') comes back as use 1}. The comma is text inside the string. The same call should come back as use 1,}.
A real trailing comma, such as "top_p": 0.9, before the closing brace, should still be removed. A missing comma between two properties should still be inserted.
Source: Lightning-AI/litgpt