Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ import torch.nn.functional as F
|
|
14 |
from collections import Counter
|
15 |
from scrub import unlearn
|
16 |
import zipfile
|
|
|
17 |
# Your model and other necessary functions
|
18 |
# Assuming model, device, final_conv, fc_params, cls_names, and any other needed components are defined elsewhere
|
19 |
# from your_model_module import model, device, final_conv, fc_params, cls_names, SaveFeatures, getCAM, tensor_2_im
|
@@ -114,7 +115,8 @@ with right_column:
|
|
114 |
# Call function to extract and display images
|
115 |
extract(uploaded_file, 'forget_set')
|
116 |
st.write("Unlearning...")
|
117 |
-
unlearn()
|
|
|
118 |
model_s = timm.create_model("rexnet_150", pretrained = True, num_classes = 17)
|
119 |
model_s.load_state_dict(torch.load('celeb-model-unlearned.pth', map_location=torch.device('cpu')))
|
120 |
model_s.eval()
|
|
|
14 |
from collections import Counter
|
15 |
from scrub import unlearn
|
16 |
import zipfile
|
17 |
+
import time
|
18 |
# Your model and other necessary functions
|
19 |
# Assuming model, device, final_conv, fc_params, cls_names, and any other needed components are defined elsewhere
|
20 |
# from your_model_module import model, device, final_conv, fc_params, cls_names, SaveFeatures, getCAM, tensor_2_im
|
|
|
115 |
# Call function to extract and display images
|
116 |
extract(uploaded_file, 'forget_set')
|
117 |
st.write("Unlearning...")
|
118 |
+
#unlearn()
|
119 |
+
time.sleep(10)
|
120 |
model_s = timm.create_model("rexnet_150", pretrained = True, num_classes = 17)
|
121 |
model_s.load_state_dict(torch.load('celeb-model-unlearned.pth', map_location=torch.device('cpu')))
|
122 |
model_s.eval()
|