caesar-one commited on
Commit
e64620e
·
verified ·
1 Parent(s): e163f4c

Upload ConstBERT

Browse files
Files changed (1) hide show
  1. modeling.py +6 -0
modeling.py CHANGED
@@ -6,6 +6,12 @@ from transformers import AutoTokenizer
6
  from .colbert_configuration import ColBERTConfig
7
  from .tokenization_utils import QueryTokenizer, DocTokenizer
8
 
 
 
 
 
 
 
9
 
10
  class NullContextManager(object):
11
  def __init__(self, dummy_resource=None):
 
6
  from .colbert_configuration import ColBERTConfig
7
  from .tokenization_utils import QueryTokenizer, DocTokenizer
8
 
9
+ # this is a hack to force huggingface hub to download the tokenizer files
10
+ try:
11
+ with open("./tokenizer_config.json", "r") as f, open("./tokenizer.json", "r") as f2, open("./vocab.txt", "r") as f3:
12
+ pass
13
+ except Exception as e:
14
+ pass
15
 
16
  class NullContextManager(object):
17
  def __init__(self, dummy_resource=None):