Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -5
src/streamlit_app.py
CHANGED
|
@@ -41,15 +41,15 @@ def get_text_file(docs):
|
|
| 41 |
#################### ๋ด์ฉ์ ์ถ๊ฐํ ๋ถ๋ถ
|
| 42 |
|
| 43 |
temp_dir = tempfile.TemporaryDirectory()
|
| 44 |
-
temp_filepath = os.path.join(temp_dir.name,
|
| 45 |
|
| 46 |
|
| 47 |
with open(temp_filepath, "wb") as f:
|
| 48 |
-
f.write(
|
| 49 |
|
| 50 |
|
| 51 |
text_loader = TextLoader(temp_filepath, encoding="utf-8")
|
| 52 |
-
text_doc = text_loader.load()
|
| 53 |
|
| 54 |
return text_doc
|
| 55 |
|
|
@@ -58,11 +58,11 @@ def get_csv_file(docs):
|
|
| 58 |
#################### ๋ด์ฉ์ ์ถ๊ฐํ ๋ถ๋ถ
|
| 59 |
|
| 60 |
temp_dir = tempfile.TemporaryDirectory()
|
| 61 |
-
temp_filepath = os.path.join(temp_dir.name,
|
| 62 |
|
| 63 |
|
| 64 |
with open(temp_filepath, "wb") as f:
|
| 65 |
-
f.write(
|
| 66 |
|
| 67 |
|
| 68 |
csv_loader = CSVLoader(
|
|
|
|
| 41 |
#################### ๋ด์ฉ์ ์ถ๊ฐํ ๋ถ๋ถ
|
| 42 |
|
| 43 |
temp_dir = tempfile.TemporaryDirectory()
|
| 44 |
+
temp_filepath = os.path.join(temp_dir.name, text_docs.name)
|
| 45 |
|
| 46 |
|
| 47 |
with open(temp_filepath, "wb") as f:
|
| 48 |
+
f.write(text_docs.getvalue())
|
| 49 |
|
| 50 |
|
| 51 |
text_loader = TextLoader(temp_filepath, encoding="utf-8")
|
| 52 |
+
text_doc = text_loader.load()
|
| 53 |
|
| 54 |
return text_doc
|
| 55 |
|
|
|
|
| 58 |
#################### ๋ด์ฉ์ ์ถ๊ฐํ ๋ถ๋ถ
|
| 59 |
|
| 60 |
temp_dir = tempfile.TemporaryDirectory()
|
| 61 |
+
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
| 62 |
|
| 63 |
|
| 64 |
with open(temp_filepath, "wb") as f:
|
| 65 |
+
f.write(csv_docs.getvalue())
|
| 66 |
|
| 67 |
|
| 68 |
csv_loader = CSVLoader(
|