parkchihoon commited on
Commit
e456282
·
1 Parent(s): a4cc689

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -38,8 +38,14 @@ def get_text_file(text_docs):
38
  return text_doc
39
 
40
 
41
- def get_csv_file(docs):
42
- pass
 
 
 
 
 
 
43
 
44
  def get_json_file(docs):
45
  pass
 
38
  return text_doc
39
 
40
 
41
+ def get_csv_file(csv_docs):
42
+ temp_dir = tempfile.TemporaryDirectory()
43
+ temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
44
+ with open(temp_filepath, "wb") as f
45
+ f.write(csv_docs.getvalue())
46
+ csv_loader = CSVLoader(temp_filepath)
47
+ csv_doc = csv_loader.load()
48
+ return csv_doc
49
 
50
  def get_json_file(docs):
51
  pass