Spaces:
Sleeping
Sleeping
return 값을 json_doc로 수정
Browse files
app.py
CHANGED
@@ -34,11 +34,11 @@ def get_text_file(txt_docs):
|
|
34 |
def get_csv_file(docs):
|
35 |
pass
|
36 |
|
37 |
-
def get_json_file(
|
38 |
-
temp_dir = tempfile.TemporaryDirectory()
|
39 |
-
temp_filepath = os.path.join(temp_dir.name,
|
40 |
-
with open(temp_filepath, "wb") as f:
|
41 |
-
f.write(
|
42 |
json_loader = JSONLoader(temp_filepath)
|
43 |
json_doc = json_loader.load()
|
44 |
return json_doc
|
|
|
34 |
def get_csv_file(docs):
|
35 |
pass
|
36 |
|
37 |
+
def get_json_file(json_docs):
|
38 |
+
temp_dir = tempfile.TemporaryDirectory()
|
39 |
+
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
40 |
+
with open(temp_filepath, "wb") as f:
|
41 |
+
f.write(json_docs.getvalue())
|
42 |
json_loader = JSONLoader(temp_filepath)
|
43 |
json_doc = json_loader.load()
|
44 |
return json_doc
|