import json import gradio as gr def save_json(text): with open("output.json", "w") as outfile: json.dump(text, outfile) return "output.json" demo = gr.Interface(save_text_as_json, "text", "file") demo.launch()