kivilaid commited on
Commit
6f084d9
·
1 Parent(s): 4147187

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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="file")
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"),