Nahyunho commited on
Commit
5f24400
โ€ข
1 Parent(s): 0235d07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -29,8 +29,13 @@ def get_pdf_text(pdf_docs):
29
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
30
 
31
  def get_text_file(docs):
32
- pass
 
 
 
 
33
 
 
34
 
35
  def get_csv_file(docs):
36
  pass
 
29
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
30
 
31
  def get_text_file(docs):
32
+ with NamedTemporaryFile() as temp_file:
33
+ temp_file.write(docs.getvalue())
34
+ temp_file.seek(0)
35
+ text_loader = TextLoader(temp_file.name)
36
+ text_doc = text_loader.load()
37
 
38
+ return text_doc
39
 
40
  def get_csv_file(docs):
41
  pass