Commit
Β·
a26e592
1
Parent(s):
a9c5456
Update app.py
Browse files
app.py
CHANGED
@@ -31,10 +31,8 @@ def get_text_file(docs):
|
|
31 |
try:
|
32 |
if file.type == 'text/plain':
|
33 |
# νμΌμ΄ .txtμΈ κ²½μ°
|
34 |
-
text = file.
|
35 |
text_list.append(text)
|
36 |
-
else:
|
37 |
-
print(f"Skipped file: {file.name} is not a text file.")
|
38 |
except Exception as e:
|
39 |
print(f"An error occurred while extracting text: {e}")
|
40 |
continue # μλ¬ λ°μ μ 건λλλλ€.
|
|
|
31 |
try:
|
32 |
if file.type == 'text/plain':
|
33 |
# νμΌμ΄ .txtμΈ κ²½μ°
|
34 |
+
text = file.getvalue().decode("utf-8") # νμΌ λ΄μ©μ utf-8 νμμΌλ‘ λμ½λ©νμ¬ ν
μ€νΈλ‘ λ³νν©λλ€.
|
35 |
text_list.append(text)
|
|
|
|
|
36 |
except Exception as e:
|
37 |
print(f"An error occurred while extracting text: {e}")
|
38 |
continue # μλ¬ λ°μ μ 건λλλλ€.
|