Shad0ws commited on
Commit
4296691
·
1 Parent(s): f6ae206

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -113,7 +113,7 @@ def infer_image(img, size=None):
113
  return image
114
 
115
 
116
- @st.experimental_singleton
117
  def load_model(path, device):
118
  model_ = torch.hub.load('ultralytics/yolov5', 'custom', path=path, force_reload=True)
119
  model_.to(device)
@@ -121,7 +121,7 @@ def load_model(path, device):
121
  return model_
122
 
123
 
124
- @st.experimental_singleton
125
  def download_model(url):
126
  model_file = wget.download(url, out="models")
127
  return model_file
 
113
  return image
114
 
115
 
116
+ @st.cache_resource
117
  def load_model(path, device):
118
  model_ = torch.hub.load('ultralytics/yolov5', 'custom', path=path, force_reload=True)
119
  model_.to(device)
 
121
  return model_
122
 
123
 
124
+ @st.cache_resource
125
  def download_model(url):
126
  model_file = wget.download(url, out="models")
127
  return model_file