Spaces:
Runtime error
Runtime error
JinHyeong99
commited on
Commit
β’
5ae388f
1
Parent(s):
d5e72bf
app.py
CHANGED
@@ -50,20 +50,19 @@ def get_csv_file(csv_docs):
|
|
50 |
|
51 |
|
52 |
def get_json_file(json_docs):
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
pass
|
67 |
|
68 |
|
69 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
|
|
50 |
|
51 |
|
52 |
def get_json_file(json_docs):
|
53 |
+
temp_dir = tempfile.TemporaryDirectory()
|
54 |
+
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
55 |
+
|
56 |
+
data = open(json_docs, mode='r', encoding='utf-8')
|
57 |
+
with open(temp_filepath) as f:
|
58 |
+
f.write(data)
|
59 |
+
|
60 |
+
json_loader = JSONLoader(
|
61 |
+
file_path = temp_filepath,
|
62 |
+
jq_schema = '.'
|
63 |
+
)
|
64 |
+
json_doc = json_loader.load()
|
65 |
+
return json_doc
|
|
|
66 |
|
67 |
|
68 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|