Skip to content

Commit

Permalink
Fix incorrect cache_data decorator in cache_resource docs (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
javi-aranda authored Nov 30, 2023
1 parent f927b01 commit 82a8d50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/library/api/performance/cache-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def load_model():
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:

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

0 comments on commit 82a8d50

Please sign in to comment.