Update src/streamlit_app.py
Browse files- src/streamlit_app.py +14 -0
src/streamlit_app.py
CHANGED
|
@@ -213,6 +213,13 @@ def main():
|
|
| 213 |
doc_list.extend(get_text_file(file))
|
| 214 |
else:
|
| 215 |
st.error("TXT ํ์ผ์ด ์๋๋๋ค.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
# CSV ๋ฒํผ ๊ตฌํ ์ฐธ๊ณ : if file.type == 'text/csv':
|
| 217 |
|
| 218 |
if st.button("Process[CSV]"):
|
|
@@ -223,6 +230,13 @@ def main():
|
|
| 223 |
doc_list.extend(get_csv_file(file))
|
| 224 |
else:
|
| 225 |
st.error("CSV ํ์ผ์ด ์๋๋๋ค.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
if st.button("Process[JSON]"):
|
| 227 |
with st.spinner("Processing"):
|
| 228 |
# get txt text
|
|
|
|
| 213 |
doc_list.extend(get_text_file(file))
|
| 214 |
else:
|
| 215 |
st.error("TXT ํ์ผ์ด ์๋๋๋ค.")
|
| 216 |
+
if not doc_list:
|
| 217 |
+
st.error("์ฒ๋ฆฌ ๊ฐ๋ฅํ TXT ๋ฌธ์๋ฅผ ์ฐพ์ง ๋ชปํ์ต๋๋ค.")
|
| 218 |
+
st.stop()
|
| 219 |
+
|
| 220 |
+
text_chunks = get_text_chunks(doc_list)
|
| 221 |
+
vectorstore = get_vectorstore(text_chunks)
|
| 222 |
+
st.session_state.conversation = get_conversation_chain(vectorstore)
|
| 223 |
# CSV ๋ฒํผ ๊ตฌํ ์ฐธ๊ณ : if file.type == 'text/csv':
|
| 224 |
|
| 225 |
if st.button("Process[CSV]"):
|
|
|
|
| 230 |
doc_list.extend(get_csv_file(file))
|
| 231 |
else:
|
| 232 |
st.error("CSV ํ์ผ์ด ์๋๋๋ค.")
|
| 233 |
+
if not doc_list:
|
| 234 |
+
st.error("์ฒ๋ฆฌ ๊ฐ๋ฅํ CSV ๋ฌธ์๋ฅผ ์ฐพ์ง ๋ชปํ์ต๋๋ค.")
|
| 235 |
+
st.stop()
|
| 236 |
+
|
| 237 |
+
text_chunks = get_text_chunks(doc_list)
|
| 238 |
+
vectorstore = get_vectorstore(text_chunks)
|
| 239 |
+
st.session_state.conversation = get_conversation_chain(vectorstore)
|
| 240 |
if st.button("Process[JSON]"):
|
| 241 |
with st.spinner("Processing"):
|
| 242 |
# get txt text
|