Restrict number of items to search
Browse files- .gitignore +2 -0
- app.py +3 -4
- clip_zeroshot_irasuto_image_items_20210224.pq.zip +2 -2
- clip_zeroshot_irasuto_items_20210224.pq.zip +2 -2
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
*.parquet
|
2 |
+
.DS_Store
|
app.py
CHANGED
@@ -12,7 +12,7 @@ import numpy as np
|
|
12 |
import scipy.spatial
|
13 |
import pyminizip
|
14 |
import transformers
|
15 |
-
from transformers import
|
16 |
from huggingface_hub import hf_hub_download, snapshot_download
|
17 |
# from PIL import Image
|
18 |
|
@@ -94,7 +94,7 @@ class ClipTextModel(nn.Module):
|
|
94 |
filename = hf_hub_download(repo_id=model_name_or_path, filename="output_linear.bin")
|
95 |
output_linear_state_dict = torch.load(filename)
|
96 |
|
97 |
-
self.model =
|
98 |
config = self.model.config
|
99 |
|
100 |
self.max_cls_depth = 6
|
@@ -105,8 +105,7 @@ class ClipTextModel(nn.Module):
|
|
105 |
# self.output_linear = nn.Linear(3 * config.hidden_size, sentence_vector_size)
|
106 |
self.output_linear.load_state_dict(output_linear_state_dict)
|
107 |
|
108 |
-
self.tokenizer =
|
109 |
-
is_fast=True, do_lower_case=True)
|
110 |
|
111 |
self.eval()
|
112 |
|
|
|
12 |
import scipy.spatial
|
13 |
import pyminizip
|
14 |
import transformers
|
15 |
+
from transformers import BertJapaneseTokenizer, BertModel
|
16 |
from huggingface_hub import hf_hub_download, snapshot_download
|
17 |
# from PIL import Image
|
18 |
|
|
|
94 |
filename = hf_hub_download(repo_id=model_name_or_path, filename="output_linear.bin")
|
95 |
output_linear_state_dict = torch.load(filename)
|
96 |
|
97 |
+
self.model = BertModel.from_pretrained(model_name_or_path)
|
98 |
config = self.model.config
|
99 |
|
100 |
self.max_cls_depth = 6
|
|
|
105 |
# self.output_linear = nn.Linear(3 * config.hidden_size, sentence_vector_size)
|
106 |
self.output_linear.load_state_dict(output_linear_state_dict)
|
107 |
|
108 |
+
self.tokenizer = BertJapaneseTokenizer.from_pretrained(model_name_or_path, do_lower_case=True)
|
|
|
109 |
|
110 |
self.eval()
|
111 |
|
clip_zeroshot_irasuto_image_items_20210224.pq.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2f602399369a485f1586b7ca04e8ae096868ecce85527928671b08bf5e80c200
|
3 |
+
size 54262882
|
clip_zeroshot_irasuto_items_20210224.pq.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:321d909ba0f92425a5107ad26a6d97dc4f7601b2b4f22ab020199f2ba2237ce7
|
3 |
+
size 104296063
|