Skip to content

Commit 82a8d50

Browse files
authored
Fix incorrect cache_data decorator in cache_resource docs (#889)
1 parent f927b01 commit 82a8d50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/library/api/performance/cache-resource.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def load_model():
7373
You can also use [interactive input widgets](/library/api-reference/widgets) like `st.slider` or `st.text_input` in cached functions. Widget replay is an experimental feature at the moment. To enable it, you need to set the `experimental_allow_widgets` parameter:
7474

7575
```python
76-
@st.cache_data(experimental_allow_widgets=True) # 👈 Set the parameter
76+
@st.cache_resource(experimental_allow_widgets=True) # 👈 Set the parameter
7777
def load_model():
7878
pretrained = st.checkbox("Use pre-trained model:") # 👈 Add a checkbox
7979
model = torchvision.models.resnet50(weights=ResNet50_Weights.DEFAULT, pretrained=pretrained)

0 commit comments

Comments
 (0)