Spaces:
Running
Running
parkchihoon
commited on
Commit
β’
9a000f4
1
Parent(s):
6e02a76
Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,14 @@ def get_csv_file(csv_docs):
|
|
47 |
csv_doc = csv_loader.load()
|
48 |
return csv_doc
|
49 |
|
50 |
-
def get_json_file(
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
|
54 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
|
|
47 |
csv_doc = csv_loader.load()
|
48 |
return csv_doc
|
49 |
|
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 |
+
f.write(json_docs.getvalue())
|
55 |
+
json_loader = JSONLoader(temp_filepath)
|
56 |
+
json_doc = json_loader.load()
|
57 |
+
return json_doc
|
58 |
|
59 |
|
60 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|