Spaces:
Build error
Build error
Commit ยท
ff7260e
1
Parent(s): 009d12e
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,9 +37,10 @@ def get_text_file(docs):
|
|
| 37 |
text_list.append(text)
|
| 38 |
|
| 39 |
# ์ฃผ์ด์ง ํ์ผ ๋ชฉ๋ก์ ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ํ์ผ์ ์ฒ๋ฆฌ
|
| 40 |
-
for file_content in docs:
|
| 41 |
-
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
# ๋ค๋ฅธ ํ์ผ ์ ํ(PDF, CSV, JSON ๋ฑ)์ ๋ํ ์ฒ๋ฆฌ
|
| 45 |
# ํ์ํ๋ค๋ฉด ์ฌ๊ธฐ์ ์ถ๊ฐ์ ์ธ ํ์ผ ์ฒ๋ฆฌ ๋ก์ง์ ๊ตฌํํฉ๋๋ค.
|
|
|
|
| 37 |
text_list.append(text)
|
| 38 |
|
| 39 |
# ์ฃผ์ด์ง ํ์ผ ๋ชฉ๋ก์ ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ํ์ผ์ ์ฒ๋ฆฌ
|
| 40 |
+
for filename, file_content in docs:
|
| 41 |
+
if filename.lower().endswith('.txt'): # ํ์ผ ํ์ฅ์ ํ์ธ
|
| 42 |
+
bytes_file = BytesIO(file_content.encode()) # BytesIO๋ก ๋ณํ
|
| 43 |
+
process_txt_file(bytes_file.getvalue()) # .txt ํ์ผ ์ฒ๋ฆฌ ํจ์ ํธ์ถ
|
| 44 |
|
| 45 |
# ๋ค๋ฅธ ํ์ผ ์ ํ(PDF, CSV, JSON ๋ฑ)์ ๋ํ ์ฒ๋ฆฌ
|
| 46 |
# ํ์ํ๋ค๋ฉด ์ฌ๊ธฐ์ ์ถ๊ฐ์ ์ธ ํ์ผ ์ฒ๋ฆฌ ๋ก์ง์ ๊ตฌํํฉ๋๋ค.
|