Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,25 @@ Built with π€ Hugging Face's [transformers](https://huggingface.co/transformer
|
|
18 |
"""
|
19 |
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
@st.cache(
|
22 |
show_spinner=False,
|
23 |
hash_funcs={
|
|
|
18 |
"""
|
19 |
|
20 |
|
21 |
+
# Session state
|
22 |
+
if 'key' not in st.session_state:
|
23 |
+
st.session_state['key'] = 'value'
|
24 |
+
if 'key' not in st.session_state:
|
25 |
+
st.session_state.key = 'value'
|
26 |
+
st.write(st.session_state.key)
|
27 |
+
st.session_state.key = 'value2' # Attribute API
|
28 |
+
st.session_state['key'] = 'value2' # Dictionary like API
|
29 |
+
st.write(st.session_state)
|
30 |
+
st.session_state
|
31 |
+
for key in st.session_state.keys():
|
32 |
+
del st.session_state[key]
|
33 |
+
st.text_input("Your name", key="name")
|
34 |
+
st.session_state.name
|
35 |
+
|
36 |
+
#def form_callback():
|
37 |
+
# st.write(st.session_state.my_slider)
|
38 |
+
# st.write(st.session_state.my_checkbox)
|
39 |
+
|
40 |
@st.cache(
|
41 |
show_spinner=False,
|
42 |
hash_funcs={
|