panda47 commited on
Commit
18f2592
1 Parent(s): 3d44199

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -51,15 +51,14 @@ def get_json_file(json_docs):
51
  temp_dir = tempfile.TemporaryDirectory()
52
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
53
  with open(temp_filepath, "wb") as f:
54
- d=f.write(json_docs.getvalue())
55
- with open(d,"r") as f:
56
- f=f.replace(',}','}')
57
- f=f.replace(',]',']')
58
  json_loader=JSONLoader(
59
  temp_filepath,
60
  jq_schema='.'
61
  #text_content=False
62
  )
 
 
63
  json_doc = json_loader.load()
64
  return json_doc
65
 
 
51
  temp_dir = tempfile.TemporaryDirectory()
52
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
53
  with open(temp_filepath, "wb") as f:
54
+ f.write(json_docs.getvalue())
 
 
 
55
  json_loader=JSONLoader(
56
  temp_filepath,
57
  jq_schema='.'
58
  #text_content=False
59
  )
60
+ json_loader.replace(',}','}')
61
+ json_loader.replace(',]',']')
62
  json_doc = json_loader.load()
63
  return json_doc
64