Spaces:
Sleeping
Sleeping
Commit
•
3e5eb40
1
Parent(s):
05702d3
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,12 @@ from PIL import Image
|
|
7 |
import json
|
8 |
import zipfile
|
9 |
import pickle
|
|
|
10 |
from transformers import AutoTokenizer, CLIPTextModelWithProjection
|
11 |
|
12 |
# loading the train dataset
|
13 |
with open('clip_train.pkl', 'rb') as f:
|
14 |
-
temp_d =
|
15 |
# train_xv = temp_d['image'].astype(np.float64) # Array of image features : np ndarray
|
16 |
# train_xt = temp_d['text'].astype(np.float64) # Array of text features : np ndarray
|
17 |
# train_yv = temp_d['label'] # Array of labels
|
@@ -20,7 +21,7 @@ with open('clip_train.pkl', 'rb') as f:
|
|
20 |
|
21 |
# loading the test dataset
|
22 |
with open('clip_test.pkl', 'rb') as f:
|
23 |
-
temp_d =
|
24 |
# test_xv = temp_d['image'].astype(np.float64)
|
25 |
test_xt = temp_d['text'].astype(np.float64)
|
26 |
# test_yv = temp_d['label']
|
|
|
7 |
import json
|
8 |
import zipfile
|
9 |
import pickle
|
10 |
+
import pickletools
|
11 |
from transformers import AutoTokenizer, CLIPTextModelWithProjection
|
12 |
|
13 |
# loading the train dataset
|
14 |
with open('clip_train.pkl', 'rb') as f:
|
15 |
+
temp_d = pickletools.dis(f)
|
16 |
# train_xv = temp_d['image'].astype(np.float64) # Array of image features : np ndarray
|
17 |
# train_xt = temp_d['text'].astype(np.float64) # Array of text features : np ndarray
|
18 |
# train_yv = temp_d['label'] # Array of labels
|
|
|
21 |
|
22 |
# loading the test dataset
|
23 |
with open('clip_test.pkl', 'rb') as f:
|
24 |
+
temp_d = pickletools.dis(f)
|
25 |
# test_xv = temp_d['image'].astype(np.float64)
|
26 |
test_xt = temp_d['text'].astype(np.float64)
|
27 |
# test_yv = temp_d['label']
|