Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -99,10 +99,9 @@ def get_conversation_chain(vectorstore):
|
|
| 99 |
# μ¬μ©μ μ
λ ₯μ μ²λ¦¬νλ ν¨μμ
λλ€.
|
| 100 |
def handle_userinput(user_question):
|
| 101 |
# λν 체μΈμ μ¬μ©νμ¬ μ¬μ©μ μ§λ¬Έμ λν μλ΅μ μμ±ν©λλ€.
|
| 102 |
-
st.session_state
|
| 103 |
-
response = st.session_state['conversation']
|
| 104 |
# λν κΈ°λ‘μ μ μ₯ν©λλ€.
|
| 105 |
-
st.session_state
|
| 106 |
|
| 107 |
for i, message in enumerate(st.session_state['chat_history']):
|
| 108 |
if i % 2 == 0:
|
|
@@ -120,9 +119,11 @@ def main():
|
|
| 120 |
st.write(css, unsafe_allow_html=True)
|
| 121 |
|
| 122 |
if "conversation" not in st.session_state:
|
| 123 |
-
st.session_state
|
|
|
|
| 124 |
if "chat_history" not in st.session_state:
|
| 125 |
-
st.session_state
|
|
|
|
| 126 |
|
| 127 |
st.header("Chat with multiple Files :")
|
| 128 |
user_question = st.text_input("Ask a question about your documents:")
|
|
|
|
| 99 |
# μ¬μ©μ μ
λ ₯μ μ²λ¦¬νλ ν¨μμ
λλ€.
|
| 100 |
def handle_userinput(user_question):
|
| 101 |
# λν 체μΈμ μ¬μ©νμ¬ μ¬μ©μ μ§λ¬Έμ λν μλ΅μ μμ±ν©λλ€.
|
| 102 |
+
response = st.session_state.conversation({'question': user_question})
|
|
|
|
| 103 |
# λν κΈ°λ‘μ μ μ₯ν©λλ€.
|
| 104 |
+
st.session_state.chat_history = response['chat_history']
|
| 105 |
|
| 106 |
for i, message in enumerate(st.session_state['chat_history']):
|
| 107 |
if i % 2 == 0:
|
|
|
|
| 119 |
st.write(css, unsafe_allow_html=True)
|
| 120 |
|
| 121 |
if "conversation" not in st.session_state:
|
| 122 |
+
st.session_state.conversation = None
|
| 123 |
+
st.session_state.chat_history = None
|
| 124 |
if "chat_history" not in st.session_state:
|
| 125 |
+
st.session_state.conversation = None
|
| 126 |
+
st.session_state.chat_history = None
|
| 127 |
|
| 128 |
st.header("Chat with multiple Files :")
|
| 129 |
user_question = st.text_input("Ask a question about your documents:")
|