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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -50,8 +50,9 @@ def get_csv_file(csv_docs):
50
  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, "r") as f:
54
- f.read(json_docs.getvalue())
 
55
  f=f.replace(',}','}')
56
  f=f.replace(',]',']')
57
  json_loader=JSONLoader(
 
50
  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(