Spaces:
Runtime error
Runtime error
JinHyeong99
commited on
Commit
•
5b9a00a
1
Parent(s):
0a4e5b0
131
Browse files
app.py
CHANGED
@@ -49,16 +49,12 @@ def get_csv_file(csv_docs):
|
|
49 |
def get_json_file(json_docs):
|
50 |
temp_dir = tempfile.TemporaryDirectory()
|
51 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
file_path = temp_filepath,
|
59 |
-
jq_schema = '.',
|
60 |
-
text_content=False
|
61 |
-
)
|
62 |
json_doc = json_loader.load()
|
63 |
return json_doc
|
64 |
|
|
|
49 |
def get_json_file(json_docs):
|
50 |
temp_dir = tempfile.TemporaryDirectory()
|
51 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
52 |
+
with open(temp_filepath, "wb") as f:
|
53 |
+
f.write(json_docs.getvalue())
|
54 |
+
json_loader = JSONLoader(temp_filepath,
|
55 |
+
jq_schema='.',
|
56 |
+
text_content=False
|
57 |
+
)
|
|
|
|
|
|
|
|
|
58 |
json_doc = json_loader.load()
|
59 |
return json_doc
|
60 |
|