DDingcheol commited on
Commit
d272441
ยท
1 Parent(s): f95d819

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -28,9 +28,14 @@ def get_pdf_text(pdf_docs):
28
  # ๊ณผ์ œ
29
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
30
 
31
- def get_text_file(docs):
32
- pass
33
-
 
 
 
 
 
34
 
35
  def get_csv_file(docs):
36
  pass
 
28
  # ๊ณผ์ œ
29
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
30
 
31
+ def get_text_file(txt_docs):
32
+ temp_dir = tempfile.TemporaryDirectory()
33
+ temp_filepath = os.path.join(temp_dir.name, txt_docs.name)
34
+ with open(temp_filepath, "wb") as f:
35
+ f.write(pdf_docs.getvalue())
36
+ txt_loader = TextLoader(temp_filepath)
37
+ txt_doc = tex_loader.load()
38
+ return tex_doc
39
 
40
  def get_csv_file(docs):
41
  pass