Spaces:
Sleeping
Sleeping
namkwonwoo
commited on
Commit
β’
75eb0a9
1
Parent(s):
5b9f44d
Update app.py
Browse files
app.py
CHANGED
@@ -44,17 +44,16 @@ def get_csv_file(csv_docs):
|
|
44 |
return csv_doc
|
45 |
|
46 |
import json
|
47 |
-
def get_json_file(
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
return text_list
|
58 |
|
59 |
|
60 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
|
|
44 |
return csv_doc
|
45 |
|
46 |
import json
|
47 |
+
def get_json_file(json_docs):
|
48 |
+
temp_dir = tempfile.TemporaryDirectory()
|
49 |
+
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
50 |
+
with open(temp_filepath, "wb") as f:
|
51 |
+
f.write(json_docs.getvalue())
|
52 |
+
json_loader = JSONLoader(file_path = temp_filepath,
|
53 |
+
jq_schema = None,
|
54 |
+
text_content=False)
|
55 |
+
json_doc = json_loader.load()
|
56 |
+
return json_doc
|
|
|
57 |
|
58 |
|
59 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|