sonoisa commited on
Commit
148e94d
1 Parent(s): b0fe4e1

Restrict number of items to search

Browse files
.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 AutoModel, AutoTokenizer
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 = AutoModel.from_pretrained(model_name_or_path)
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 = AutoTokenizer.from_pretrained(model_name_or_path,
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:4bb0832140a68bc4e47ef63f9600852f978b2d52fc8f2091eaf021b1291717e3
3
- size 72074172
 
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:61ea93dcba23ee05b0b97e880aab395f7e82375d11c82b0a743940897fa1a2e4
3
- size 122826331
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:321d909ba0f92425a5107ad26a6d97dc4f7601b2b4f22ab020199f2ba2237ce7
3
+ size 104296063