edqwd commited on
Commit
f28b506
ยท
verified ยท
1 Parent(s): e8a087d

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -5
src/streamlit_app.py CHANGED
@@ -41,15 +41,15 @@ def get_text_file(docs):
41
  #################### ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•  ๋ถ€๋ถ„
42
 
43
  temp_dir = tempfile.TemporaryDirectory()
44
- temp_filepath = os.path.join(temp_dir.name, docs.name)
45
 
46
 
47
  with open(temp_filepath, "wb") as f:
48
- f.write(docs.getvalue())
49
 
50
 
51
  text_loader = TextLoader(temp_filepath, encoding="utf-8")
52
- text_doc = text_loader.load() # -> List[Document]
53
 
54
  return text_doc
55
 
@@ -58,11 +58,11 @@ def get_csv_file(docs):
58
  #################### ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•  ๋ถ€๋ถ„
59
 
60
  temp_dir = tempfile.TemporaryDirectory()
61
- temp_filepath = os.path.join(temp_dir.name, docs.name)
62
 
63
 
64
  with open(temp_filepath, "wb") as f:
65
- f.write(docs.getvalue())
66
 
67
 
68
  csv_loader = CSVLoader(
 
41
  #################### ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•  ๋ถ€๋ถ„
42
 
43
  temp_dir = tempfile.TemporaryDirectory()
44
+ temp_filepath = os.path.join(temp_dir.name, text_docs.name)
45
 
46
 
47
  with open(temp_filepath, "wb") as f:
48
+ f.write(text_docs.getvalue())
49
 
50
 
51
  text_loader = TextLoader(temp_filepath, encoding="utf-8")
52
+ text_doc = text_loader.load()
53
 
54
  return text_doc
55
 
 
58
  #################### ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•  ๋ถ€๋ถ„
59
 
60
  temp_dir = tempfile.TemporaryDirectory()
61
+ temp_filepath = os.path.join(temp_dir.name, csv_docs.name)
62
 
63
 
64
  with open(temp_filepath, "wb") as f:
65
+ f.write(csv_docs.getvalue())
66
 
67
 
68
  csv_loader = CSVLoader(