Feature Extraction
Transformers
Safetensors
English
bert
retrieval
constbert
colbert
multi-vector
embedding
custom_code
text-embeddings-inference
Instructions to use pinecone/ConstBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pinecone/ConstBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="pinecone/ConstBERT", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("pinecone/ConstBERT", trust_remote_code=True) model = AutoModel.from_pretrained("pinecone/ConstBERT", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Upload ConstBERT
Browse files- 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):
|