Spaces:
Sleeping
Sleeping
RishabhBhardwaj
commited on
Commit
·
6507278
1
Parent(s):
3a2e507
try4
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ Answer: [/INST]
|
|
14 |
"""
|
15 |
|
16 |
# Load the model and tokenizer
|
17 |
-
@st.cache_data(
|
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(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))
|