ai
Browse files
app.py
CHANGED
@@ -38,9 +38,7 @@ def get_text_file(txt_docs):
|
|
38 |
|
39 |
def get_csv_file(csv_docs):
|
40 |
temp_dir = tempfile.TemporaryDirectory()
|
41 |
-
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
42 |
-
with open(temp_filepath, "wb") as f:
|
43 |
-
f.write(csv_docs.getvalue())
|
44 |
csv_loader = CSVLoader(temp_filepath)
|
45 |
csv_doc = csv_loader.load()
|
46 |
return csv_doc
|
@@ -48,9 +46,6 @@ def get_csv_file(csv_docs):
|
|
48 |
def get_json_file(json_docs):
|
49 |
temp_dir = tempfile.TemporaryDirectory()
|
50 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
51 |
-
with open(temp_filepath, "wb") as f: # ์์ ํ์ผ์ ๋ฐ์ด๋๋ฆฌ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
52 |
-
json.write(f)
|
53 |
-
|
54 |
json_loader = JSONLoader(temp_filepath)
|
55 |
json_doc = json_loader.load()
|
56 |
return json_doc
|
|
|
38 |
|
39 |
def get_csv_file(csv_docs):
|
40 |
temp_dir = tempfile.TemporaryDirectory()
|
41 |
+
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
|
|
|
|
42 |
csv_loader = CSVLoader(temp_filepath)
|
43 |
csv_doc = csv_loader.load()
|
44 |
return csv_doc
|
|
|
46 |
def get_json_file(json_docs):
|
47 |
temp_dir = tempfile.TemporaryDirectory()
|
48 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
|
|
|
|
|
|
49 |
json_loader = JSONLoader(temp_filepath)
|
50 |
json_doc = json_loader.load()
|
51 |
return json_doc
|