DDingcheol commited on
Commit
5828fce
ยท
1 Parent(s): 64a2b6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -28,7 +28,8 @@ def get_pdf_text(pdf_docs):
28
  def get_text_file(docs):
29
  text_list = []
30
  for doc in docs:
31
- text = doc.read().decode('utf-8') # 'bytes' ๊ฐ์ฒด๋ฅผ ์ฝ๊ณ  'utf-8'๋กœ ๋””์ฝ”๋”ฉํ•˜์—ฌ ํ…์ŠคํŠธ๋ฅผ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค.
 
32
  text_list.append(text)
33
  return text_list
34
 
 
28
  def get_text_file(docs):
29
  text_list = []
30
  for doc in docs:
31
+ doc_bytes = BytesIO(doc.read()) # ๋ฐ”์ดํŠธ ๊ฐ์ฒด๋ฅผ ํŒŒ์ผ ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
32
+ text = doc_bytes.read().decode('utf-8') # ํŒŒ์ผ์„ ์ฝ๊ณ  'utf-8'๋กœ ๋””์ฝ”๋”ฉํ•˜์—ฌ ํ…์ŠคํŠธ๋ฅผ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค.
33
  text_list.append(text)
34
  return text_list
35