lds204 commited on
Commit
c567a11
โ€ข
1 Parent(s): 1f912ed
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -38,9 +38,7 @@ def get_text_file(txt_docs):
38
 
39
  def get_csv_file(csv_docs):
40
  temp_dir = tempfile.TemporaryDirectory()
41
- temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
42
- with open(temp_filepath, "wb") as f:
43
- f.write(csv_docs.getvalue())
44
  csv_loader = CSVLoader(temp_filepath)
45
  csv_doc = csv_loader.load()
46
  return csv_doc
@@ -48,9 +46,6 @@ def get_csv_file(csv_docs):
48
  def get_json_file(json_docs):
49
  temp_dir = tempfile.TemporaryDirectory()
50
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
51
- with open(temp_filepath, "wb") as f: # ์ž„์‹œ ํŒŒ์ผ์„ ๋ฐ”์ด๋„ˆ๋ฆฌ ์“ฐ๊ธฐ ๋ชจ๋“œ๋กœ ์—ฝ๋‹ˆ๋‹ค.
52
- json.write(f)
53
-
54
  json_loader = JSONLoader(temp_filepath)
55
  json_doc = json_loader.load()
56
  return json_doc
 
38
 
39
  def get_csv_file(csv_docs):
40
  temp_dir = tempfile.TemporaryDirectory()
41
+ temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
 
 
42
  csv_loader = CSVLoader(temp_filepath)
43
  csv_doc = csv_loader.load()
44
  return csv_doc
 
46
  def get_json_file(json_docs):
47
  temp_dir = tempfile.TemporaryDirectory()
48
  temp_filepath = os.path.join(temp_dir.name, json_docs.name)
 
 
 
49
  json_loader = JSONLoader(temp_filepath)
50
  json_doc = json_loader.load()
51
  return json_doc