hyonee commited on
Commit
cbfbc38
โ€ข
1 Parent(s): 48d4ded
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -29,7 +29,7 @@ def get_pdf_text(pdf_docs):
29
  # ๊ณผ์ œ
30
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
31
 
32
- def get_text_file(docs):
33
  temp_dir = tempfile.TemporaryDirectory()
34
  temp_filepath = os.path.join(temp_dir.name, text_docs.name)
35
  with open(temp_filepath, "wb") as f:
@@ -39,7 +39,7 @@ def get_text_file(docs):
39
  temp_dir.cleanup()
40
  return text_content
41
 
42
- def get_csv_file(docs):
43
  temp_dir = tempfile.TemporaryDirectory()
44
  temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
45
  with open(temp_filepath, "wb") as f:
@@ -49,12 +49,6 @@ def get_csv_file(docs):
49
  temp_dir.cleanup()
50
  return csv_content
51
 
52
- with open(temp_filepath, "r", encoding="utf-8") as csv_file:
53
- csv_reader = csv.reader(csv_file)
54
- csv_data = [row for row in csv_reader]
55
-
56
- return csv_data
57
-
58
  def get_json_file(json_docs):
59
  with tempfile.TemporaryDirectory() as temp_dir:
60
  temp_filepath = os.path.join(temp_dir, "temp_file.json")
 
29
  # ๊ณผ์ œ
30
  # ์•„๋ž˜ ํ…์ŠคํŠธ ์ถ”์ถœ ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑ
31
 
32
+ def get_text_file(text_docs):
33
  temp_dir = tempfile.TemporaryDirectory()
34
  temp_filepath = os.path.join(temp_dir.name, text_docs.name)
35
  with open(temp_filepath, "wb") as f:
 
39
  temp_dir.cleanup()
40
  return text_content
41
 
42
+ def get_csv_file(csv_docs):
43
  temp_dir = tempfile.TemporaryDirectory()
44
  temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
45
  with open(temp_filepath, "wb") as f:
 
49
  temp_dir.cleanup()
50
  return csv_content
51
 
 
 
 
 
 
 
52
  def get_json_file(json_docs):
53
  with tempfile.TemporaryDirectory() as temp_dir:
54
  temp_filepath = os.path.join(temp_dir, "temp_file.json")