Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
awacke1
/
StreamlitStatefulSingleton
like
1
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
569cf30
StreamlitStatefulSingleton
/
app.py
awacke1
Update app.py
569cf30
about 3 years ago
raw
Copy download link
history
blame
Safe
236 Bytes
@st.experimental_memo
def
foo
(
x
):
return
x**
2
if
st.button(
"Clear Foo"
):
# Clear foo's memoized values:
foo.clear()
if
st.button(
"Clear All"
):
# Clear values from *all* memoized functions:
st.experimental_memo.clear()