Update app.py
Browse files
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 |
-
|
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 |
|