Spaces:
Sleeping
Sleeping
Commit
Β·
8c8e598
1
Parent(s):
d51d064
Update app.py
Browse files
app.py
CHANGED
@@ -27,9 +27,14 @@ def get_pdf_text(pdf_docs):
|
|
27 |
def get_text_file(docs):
|
28 |
text_list = []
|
29 |
for doc in docs:
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
text_list.append(text)
|
32 |
-
return text_list
|
|
|
33 |
|
34 |
def get_csv_file(docs):
|
35 |
pass
|
|
|
27 |
def get_text_file(docs):
|
28 |
text_list = []
|
29 |
for doc in docs:
|
30 |
+
# νμΌμ νμ
μ νμΈνμ¬ μ²λ¦¬ν©λλ€.
|
31 |
+
if isinstance(doc, bytes):
|
32 |
+
text = doc.decode("utf-8") # bytes κ°μ²΄μΈ κ²½μ° λμ½λ©νμ¬ λ¬Έμμ΄λ‘ λ³νν©λλ€.
|
33 |
+
else:
|
34 |
+
text = doc.read().decode("utf-8") # νμΌ κ°μ²΄μΈ κ²½μ° read() λ©μλλ₯Ό μ¬μ©νμ¬ μ½κ³ λμ½λ©ν©λλ€.
|
35 |
text_list.append(text)
|
36 |
+
return text_list
|
37 |
+
|
38 |
|
39 |
def get_csv_file(docs):
|
40 |
pass
|