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 |
|