Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def get_pdf_text(pdf_docs):
|
|
| 28 |
# ๊ณผ์
|
| 29 |
# ์๋ ํ
์คํธ ์ถ์ถ ํจ์๋ฅผ ์์ฑ
|
| 30 |
# txt ๋ฌธ์๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์
|
| 31 |
-
def get_text_file(
|
| 32 |
temp_dir = tempfile.TemporaryDirectory()
|
| 33 |
temp_filepath = os.path.join(temp_dir.name, txt_docs.name)
|
| 34 |
with open(temp_filepath, "wb") as f:
|
|
@@ -39,7 +39,7 @@ def get_text_file(docs):
|
|
| 39 |
|
| 40 |
|
| 41 |
# csv ๋ฌธ์๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์
|
| 42 |
-
def get_csv_file(
|
| 43 |
temp_dir = tempfile.TemporaryDirectory()
|
| 44 |
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
| 45 |
with open(temp_filepath, "wb") as f:
|
|
@@ -50,7 +50,7 @@ def get_csv_file(docs):
|
|
| 50 |
|
| 51 |
|
| 52 |
# json ๋ฌธ์๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์
|
| 53 |
-
def get_json_file(
|
| 54 |
temp_dir = tempfile.TemporaryDirectory()
|
| 55 |
temp_filepath = os.path.join(temp_dir.name, file.name)
|
| 56 |
with open(temp_filepath, "wb") as f:
|
|
|
|
| 28 |
# ๊ณผ์
|
| 29 |
# ์๋ ํ
์คํธ ์ถ์ถ ํจ์๋ฅผ ์์ฑ
|
| 30 |
# txt ๋ฌธ์๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์
|
| 31 |
+
def get_text_file(txt_docs):
|
| 32 |
temp_dir = tempfile.TemporaryDirectory()
|
| 33 |
temp_filepath = os.path.join(temp_dir.name, txt_docs.name)
|
| 34 |
with open(temp_filepath, "wb") as f:
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
# csv ๋ฌธ์๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์
|
| 42 |
+
def get_csv_file(csv_docs):
|
| 43 |
temp_dir = tempfile.TemporaryDirectory()
|
| 44 |
temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
|
| 45 |
with open(temp_filepath, "wb") as f:
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
# json ๋ฌธ์๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์
|
| 53 |
+
def get_json_file(json_file):
|
| 54 |
temp_dir = tempfile.TemporaryDirectory()
|
| 55 |
temp_filepath = os.path.join(temp_dir.name, file.name)
|
| 56 |
with open(temp_filepath, "wb") as f:
|