Update app.py
Browse files
app.py
CHANGED
@@ -109,11 +109,13 @@ with st.sidebar:
|
|
109 |
|
110 |
st.info("This isn't saved π")
|
111 |
|
112 |
-
|
113 |
-
|
|
|
|
|
114 |
|
115 |
-
if "past" not in st.session_state:
|
116 |
-
|
117 |
|
118 |
def get_text():
|
119 |
user_input = st.text_input("You: ", "Who are you?", key="input")
|
@@ -132,11 +134,14 @@ if ask:
|
|
132 |
except:
|
133 |
output = "What's going on? That's not the right API key"
|
134 |
|
135 |
-
st.
|
136 |
-
st.session_state.generated.append(output)
|
137 |
|
138 |
-
|
|
|
|
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
109 |
|
110 |
st.info("This isn't saved π")
|
111 |
|
112 |
+
# streamlit-chat not working
|
113 |
+
# i get this error: https://discuss.streamlit.io/t/your-app-is-having-trouble-loading-the-xxx-component/25046
|
114 |
+
# if "generated" not in st.session_state:
|
115 |
+
# st.session_state["generated"] = []
|
116 |
|
117 |
+
# if "past" not in st.session_state:
|
118 |
+
# st.session_state["past"] = []
|
119 |
|
120 |
def get_text():
|
121 |
user_input = st.text_input("You: ", "Who are you?", key="input")
|
|
|
134 |
except:
|
135 |
output = "What's going on? That's not the right API key"
|
136 |
|
137 |
+
st.text(label="1984:", value=output)
|
|
|
138 |
|
139 |
+
# streamlit-chat
|
140 |
+
# st.session_state.past.append(user_input)
|
141 |
+
# st.session_state.generated.append(output)
|
142 |
|
143 |
+
# if st.session_state["generated"]:
|
144 |
+
|
145 |
+
# for i in range(len(st.session_state["generated"]) - 1, -1, -1):
|
146 |
+
# message(st.session_state["generated"][i], key=str(i))
|
147 |
+
# message(st.session_state["past"][i], is_user=True, key=str(i) + "_user")
|