JinHyeong99 commited on
Commit
131879f
โ€ข
1 Parent(s): 7d47c0f
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -29,6 +29,8 @@ def get_pdf_text(pdf_docs):
29
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
30
 
31
  def get_text_file(text_docs):
 
 
32
  text_loader = TextLoader(text_docs.name)
33
  text_doc = text_loader.load()
34
  return text_doc
 
29
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
30
 
31
  def get_text_file(text_docs):
32
+ temp_dir = tempfile.TemporaryDirectory() # ์ž„์‹œ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
33
+ temp_filepath = os.path.join(temp_dir.name, text_docs.name) # ์ž„์‹œ ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
34
  text_loader = TextLoader(text_docs.name)
35
  text_doc = text_loader.load()
36
  return text_doc