Commit
ยท
96060c4
1
Parent(s):
6edfa7e
Update app.py
Browse files
app.py
CHANGED
@@ -37,12 +37,12 @@ def get_text_file(docs):
|
|
37 |
text_list.append(text)
|
38 |
|
39 |
# ์ฃผ์ด์ง ํ์ผ ๋ชฉ๋ก์ ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ํ์ผ์ ์ฒ๋ฆฌ
|
40 |
-
for
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
|
47 |
# ๋ค๋ฅธ ํ์ผ ์ ํ(PDF, CSV, JSON ๋ฑ)์ ๋ํ ์ฒ๋ฆฌ
|
48 |
# ํ์ํ๋ค๋ฉด ์ฌ๊ธฐ์ ์ถ๊ฐ์ ์ธ ํ์ผ ์ฒ๋ฆฌ ๋ก์ง์ ๊ตฌํํฉ๋๋ค.
|
@@ -51,7 +51,6 @@ def get_text_file(docs):
|
|
51 |
|
52 |
|
53 |
|
54 |
-
|
55 |
def get_csv_file(docs):
|
56 |
text_list = []
|
57 |
for doc in docs:
|
|
|
37 |
text_list.append(text)
|
38 |
|
39 |
# ์ฃผ์ด์ง ํ์ผ ๋ชฉ๋ก์ ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ํ์ผ์ ์ฒ๋ฆฌ
|
40 |
+
for file_content in docs:
|
41 |
+
try:
|
42 |
+
file_content.decode("utf-8") # ํ์ผ ๋ด์ฉ์ด ์ ์ํ์ง ํ์ธ
|
43 |
+
process_txt_file(file_content) # .txt ํ์ผ ์ฒ๋ฆฌ ํจ์ ํธ์ถ
|
44 |
+
except Exception as e:
|
45 |
+
pass # ํ
์คํธ๊ฐ ์๋ ํ์ผ์ ๊ฑด๋๋๋๋ค.
|
46 |
|
47 |
# ๋ค๋ฅธ ํ์ผ ์ ํ(PDF, CSV, JSON ๋ฑ)์ ๋ํ ์ฒ๋ฆฌ
|
48 |
# ํ์ํ๋ค๋ฉด ์ฌ๊ธฐ์ ์ถ๊ฐ์ ์ธ ํ์ผ ์ฒ๋ฆฌ ๋ก์ง์ ๊ตฌํํฉ๋๋ค.
|
|
|
51 |
|
52 |
|
53 |
|
|
|
54 |
def get_csv_file(docs):
|
55 |
text_list = []
|
56 |
for doc in docs:
|