Commit Β·
bd29c3c
1
Parent(s): 3fecf20
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,17 +27,14 @@ def get_pdf_text(pdf_docs):
|
|
| 27 |
# μλ ν
μ€νΈ μΆμΆ ν¨μλ₯Ό μμ±
|
| 28 |
def get_text_file(docs):
|
| 29 |
text_list = []
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
continue
|
| 39 |
-
except Exception as ex:
|
| 40 |
-
print(f"An error occurred while processing files: {ex}")
|
| 41 |
return text_list
|
| 42 |
|
| 43 |
def get_csv_file(docs):
|
|
|
|
| 27 |
# μλ ν
μ€νΈ μΆμΆ ν¨μλ₯Ό μμ±
|
| 28 |
def get_text_file(docs):
|
| 29 |
text_list = []
|
| 30 |
+
for file in docs:
|
| 31 |
+
if file.type == 'text/plain':
|
| 32 |
+
# νμΌμ΄ .txtμΈ κ²½μ°
|
| 33 |
+
text = file.getvalue().decode("utf-8") # νμΌ λ΄μ©μ utf-8 νμμΌλ‘ λμ½λ©νμ¬ ν
μ€νΈλ‘ λ³νν©λλ€.
|
| 34 |
+
text_list.append(text)
|
| 35 |
+
else:
|
| 36 |
+
print(f"Unsupported file type: {file.type}. Skipping processing.")
|
| 37 |
+
|
|
|
|
|
|
|
|
|
|
| 38 |
return text_list
|
| 39 |
|
| 40 |
def get_csv_file(docs):
|