Spaces:
Running
Running
Commit
•
3a2e507
1
Parent(s):
9f022b6
try3
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ Answer: [/INST]
|
|
14 |
"""
|
15 |
|
16 |
# Load the model and tokenizer
|
17 |
-
@st.
|
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()
|
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(allow_output_mutation=True)
|
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(allow_output_mutation=True)
|
26 |
def load_image_from_url(url):
|
27 |
response = requests.get(url)
|
28 |
img = Image.open(BytesIO(response.content))
|