jianfch / stable-ts

Transcription, forced alignment, and audio indexing with OpenAI's Whisper
MIT License
1.59k stars 176 forks source link

Improve save_as_json #273

Closed JeremyCollinsMPI closed 9 months ago

JeremyCollinsMPI commented 10 months ago

Could you please change line 602 in text_output.py to "result = json.dumps(result, allow_nan=True, indent=4, ensure_ascii=False)"? It currently stores the json output without indentation and not allowing non-ascii characters.

jianfch commented 10 months ago

ensure_ascii=False was made default in 738fd98490584c492cf2f7873bdddaf7a0ec9d40, but indent will remain optional because it increases the final size. You can pass it in as a argument when saving result.save_as_json(..., indent=4).