Alex commited on
Commit
65fad7a
1 Parent(s): 21594bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -7
app.py CHANGED
@@ -26,13 +26,31 @@ with st.sidebar:
26
  add_vertical_space(5)
27
  st.write('Made with ❤️ by EinfachAlex')
28
 
29
- # Generate empty lists for generated and past.
30
- ## generated stores AI generated responses
31
- if 'generated' not in st.session_state:
32
- st.session_state['generated'] = ["Hallo, wie kann ich dir helfen ?"]
33
- ## past stores User's questions
34
- if 'past' not in st.session_state:
35
- st.session_state['past'] = ['Hi!']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  # Layout of input/response containers
38
  input_container = st.container()
 
26
  add_vertical_space(5)
27
  st.write('Made with ❤️ by EinfachAlex')
28
 
29
+ 2023-05-18 21:30:13.025
30
+ Warning: to view this Streamlit app on a browser, run it with the following
31
+ command:
32
+
33
+ streamlit run app.py [ARGUMENTS]
34
+ 2023-05-18 21:30:13.026 Session state does not function when running a script without `streamlit run`
35
+ Traceback (most recent call last):
36
+ File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/state/session_state.py", line 376, in __getitem__
37
+ return self._getitem(widget_id, key)
38
+ File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/state/session_state.py", line 421, in _getitem
39
+ raise KeyError
40
+ KeyError
41
+
42
+ During handling of the above exception, another exception occurred:
43
+
44
+ Traceback (most recent call last):
45
+ File "app.py", line 68, in <module>
46
+ if st.session_state['generated']:
47
+ File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/state/session_state_proxy.py", line 90, in __getitem__
48
+ return get_session_state()[key]
49
+ File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/state/safe_session_state.py", line 113, in __getitem__
50
+ return self._state[key]
51
+ File "/home/user/.local/lib/python3.8/site-packages/streamlit/runtime/state/session_state.py", line 378, in __getitem__
52
+ raise KeyError(_missing_key_error_message(key))
53
+ KeyError: 'st.session_state has no key "generated". Did you forget to initialize it? More info: https://docs.streamlit.io/library/advanced-features/session-state#initialization'
54
 
55
  # Layout of input/response containers
56
  input_container = st.container()