DDingcheol commited on
Commit
0df3cee
ยท
1 Parent(s): 394ee12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -25,8 +25,13 @@ def get_pdf_text(pdf_docs):
25
  # ๊ณผ์ œ
26
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
27
  def get_text_file(docs):
28
- txt_content = docs.read().decode("utf-8")
29
- return [txt_content]
 
 
 
 
 
30
 
31
  def get_csv_file(docs):
32
  pass
 
25
  # ๊ณผ์ œ
26
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
27
  def get_text_file(docs):
28
+ text_list = [] # ํ…์ŠคํŠธ๋ฅผ ์ €์žฅํ•  ๋ฆฌ์ŠคํŠธ
29
+
30
+ for doc in docs:
31
+ content = doc.getvalue().decode("utf-8") # ํŒŒ์ผ ๋‚ด์šฉ์„ ๊ฐ€์ ธ์™€์„œ UTF-8๋กœ ๋””์ฝ”๋”ฉํ•˜์—ฌ ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜
32
+ text_list.append(content) # ํ…์ŠคํŠธ๋ฅผ ๋ฆฌ์ŠคํŠธ์— ์ถ”๊ฐ€
33
+
34
+ return text_list # ํ…์ŠคํŠธ๊ฐ€ ๋‹ด๊ธด ๋ฆฌ์ŠคํŠธ ๋ฐ˜ํ™˜
35
 
36
  def get_csv_file(docs):
37
  pass