James332 commited on
Commit
958ef06
Β·
1 Parent(s): 5992b59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -24,14 +24,21 @@ def get_pdf_text(pdf_docs):
24
 
25
  # 과제
26
  # μ•„λž˜ ν…μŠ€νŠΈ μΆ”μΆœ ν•¨μˆ˜λ₯Ό μž‘μ„±
27
- def get_text_file(docs):
28
- pass
29
-
30
- def get_csv_file(docs):
31
- pass
 
 
 
 
 
 
 
 
 
32
 
33
- def get_json_file(docs):
34
- pass
35
 
36
 
37
  # λ¬Έμ„œλ“€μ„ μ²˜λ¦¬ν•˜μ—¬ ν…μŠ€νŠΈ 청크둜 λ‚˜λˆ„λŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.
 
24
 
25
  # 과제
26
  # μ•„λž˜ ν…μŠ€νŠΈ μΆ”μΆœ ν•¨μˆ˜λ₯Ό μž‘μ„±
27
+ def get_text_file(doc):
28
+ # .txt 파일의 경우 ν…μŠ€νŠΈλ₯Ό κ·ΈλŒ€λ‘œ λ°˜ν™˜ν•©λ‹ˆλ‹€.
29
+ text = doc.getvalue().decode("utf-8")
30
+ return [text]
31
+
32
+ def get_csv_file(doc):
33
+ # .csv 파일의 경우 ν…μŠ€νŠΈλ‘œ λ³€ν™˜ν•˜μ—¬ λ°˜ν™˜ν•©λ‹ˆλ‹€.
34
+ text = doc.getvalue().decode("utf-8")
35
+ return [text]
36
+
37
+ def get_json_file(doc):
38
+ # .json 파일의 경우 ν…μŠ€νŠΈλ‘œ λ³€ν™˜ν•˜μ—¬ λ°˜ν™˜ν•©λ‹ˆλ‹€.
39
+ text = doc.getvalue().decode("utf-8")
40
+ return [text]
41
 
 
 
42
 
43
 
44
  # λ¬Έμ„œλ“€μ„ μ²˜λ¦¬ν•˜μ—¬ ν…μŠ€νŠΈ 청크둜 λ‚˜λˆ„λŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.