Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ def minify_json(input_json=None, input_file=None):
|
|
| 7 |
if input_json:
|
| 8 |
data = json.loads(input_json)
|
| 9 |
elif input_file:
|
| 10 |
-
data = json.load(input_file)
|
| 11 |
else:
|
| 12 |
return "No input provided.", None
|
| 13 |
|
|
@@ -22,7 +22,7 @@ iface = gr.Interface(
|
|
| 22 |
fn=minify_json,
|
| 23 |
inputs=[
|
| 24 |
gr.Textbox(label="Input JSON (Text)", placeholder="Enter JSON here...", lines=10),
|
| 25 |
-
gr.File(label="Input JSON (File)", type="
|
| 26 |
],
|
| 27 |
outputs=[
|
| 28 |
gr.Textbox(label="Minified JSON (Text)", lines=10, type="str"),
|
|
|
|
| 7 |
if input_json:
|
| 8 |
data = json.loads(input_json)
|
| 9 |
elif input_file:
|
| 10 |
+
data = json.load(input_file.file)
|
| 11 |
else:
|
| 12 |
return "No input provided.", None
|
| 13 |
|
|
|
|
| 22 |
fn=minify_json,
|
| 23 |
inputs=[
|
| 24 |
gr.Textbox(label="Input JSON (Text)", placeholder="Enter JSON here...", lines=10),
|
| 25 |
+
gr.File(label="Input JSON (File)", type="filepath")
|
| 26 |
],
|
| 27 |
outputs=[
|
| 28 |
gr.Textbox(label="Minified JSON (Text)", lines=10, type="str"),
|