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