Commit
ยท
ef30a5d
1
Parent(s):
bfe1ead
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,19 +27,10 @@ def get_pdf_text(pdf_docs):
|
|
| 27 |
# ์๋ ํ
์คํธ ์ถ์ถ ํจ์๋ฅผ ์์ฑ
|
| 28 |
def get_text_file(docs):
|
| 29 |
text_list = []
|
| 30 |
-
for
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
if file_extension == 'txt':
|
| 36 |
-
# ํ์ผ์ด .txt์ธ ๊ฒฝ์ฐ
|
| 37 |
-
text = file.getvalue().decode("utf-8") # ํ์ผ ๋ด์ฉ์ utf-8 ํ์์ผ๋ก ๋์ฝ๋ฉํ์ฌ ํ
์คํธ๋ก ๋ณํํฉ๋๋ค.
|
| 38 |
-
text_list.append(text)
|
| 39 |
-
else:
|
| 40 |
-
print(f"Unsupported file type: {file_extension}. Skipping processing.")
|
| 41 |
-
except Exception as e:
|
| 42 |
-
print(f"An error occurred while processing the file: {e}")
|
| 43 |
|
| 44 |
return text_list
|
| 45 |
|
|
|
|
| 27 |
# ์๋ ํ
์คํธ ์ถ์ถ ํจ์๋ฅผ ์์ฑ
|
| 28 |
def get_text_file(docs):
|
| 29 |
text_list = []
|
| 30 |
+
for doc in docs:
|
| 31 |
+
text = doc.getvalue().decode('utf-8')
|
| 32 |
+
text_list.append(text)
|
| 33 |
+
return text_list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
return text_list
|
| 36 |
|