DDingcheol commited on
Commit
a26e592
Β·
1 Parent(s): a9c5456

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
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.read().decode("utf-8") # 파일 λ‚΄μš©μ„ utf-8 ν˜•μ‹μœΌλ‘œ λ””μ½”λ”©ν•˜μ—¬ ν…μŠ€νŠΈλ‘œ λ³€ν™˜ν•©λ‹ˆλ‹€.
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 # μ—λŸ¬ λ°œμƒ μ‹œ κ±΄λ„ˆλœλ‹ˆλ‹€.