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 +2 -2
- tokenization_utils.py +1 -1
modeling.py
CHANGED
|
@@ -3,8 +3,8 @@ from transformers import BertPreTrainedModel, BertModel, AutoTokenizer
|
|
| 3 |
import torch
|
| 4 |
from tqdm import tqdm
|
| 5 |
from transformers import AutoTokenizer
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
|
| 9 |
|
| 10 |
class NullContextManager(object):
|
|
|
|
| 3 |
import torch
|
| 4 |
from tqdm import tqdm
|
| 5 |
from transformers import AutoTokenizer
|
| 6 |
+
from .colbert_configuration import ColBERTConfig
|
| 7 |
+
from .tokenization_utils import QueryTokenizer, DocTokenizer
|
| 8 |
|
| 9 |
|
| 10 |
class NullContextManager(object):
|
tokenization_utils.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import torch
|
| 2 |
-
from
|
| 3 |
from transformers import AutoTokenizer
|
| 4 |
|
| 5 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 1 |
import torch
|
| 2 |
+
from .colbert_configuration import ColBERTConfig
|
| 3 |
from transformers import AutoTokenizer
|
| 4 |
|
| 5 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|