RishabhBhardwaj commited on
Commit
6507278
1 Parent(s): 3a2e507
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,7 +14,7 @@ Answer: [/INST]
14
  """
15
 
16
  # Load the model and tokenizer
17
- @st.cache_data(allow_output_mutation=True)
18
  def load_model():
19
  model_name = "walledai/walledguard-c"
20
  tokenizer = AutoTokenizer.from_pretrained(model_name)
@@ -22,7 +22,7 @@ def load_model():
22
  return tokenizer, model
23
 
24
  # Function to load image from URL
25
- @st.cache_resource(allow_output_mutation=True)
26
  def load_image_from_url(url):
27
  response = requests.get(url)
28
  img = Image.open(BytesIO(response.content))
 
14
  """
15
 
16
  # Load the model and tokenizer
17
+ @st.cache_data(persist="disk")
18
  def load_model():
19
  model_name = "walledai/walledguard-c"
20
  tokenizer = AutoTokenizer.from_pretrained(model_name)
 
22
  return tokenizer, model
23
 
24
  # Function to load image from URL
25
+ @st.cache_resource(persist="disk")
26
  def load_image_from_url(url):
27
  response = requests.get(url)
28
  img = Image.open(BytesIO(response.content))