yeftakun commited on
Commit
8d9c7a4
·
verified ·
1 Parent(s): 3155a4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -5,7 +5,7 @@ import requests
5
  from io import BytesIO
6
 
7
  # Load the model and processor
8
- @st.experimental_singleton
9
  def load_model():
10
  processor = ViTImageProcessor.from_pretrained('AdamCodd/vit-base-nsfw-detector')
11
  model = AutoModelForImageClassification.from_pretrained('AdamCodd/vit-base-nsfw-detector')
 
5
  from io import BytesIO
6
 
7
  # Load the model and processor
8
+ @st.cache_data
9
  def load_model():
10
  processor = ViTImageProcessor.from_pretrained('AdamCodd/vit-base-nsfw-detector')
11
  model = AutoModelForImageClassification.from_pretrained('AdamCodd/vit-base-nsfw-detector')