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
modeling.py
CHANGED
|
@@ -90,10 +90,10 @@ class ConstBERT(BertPreTrainedModel):
|
|
| 90 |
|
| 91 |
|
| 92 |
@classmethod
|
| 93 |
-
def from_pretrained(cls, name_or_path):
|
| 94 |
colbert_config = ColBERTConfig(name_or_path)
|
| 95 |
colbert_config = ColBERTConfig.from_existing(ColBERTConfig.load_from_checkpoint(name_or_path), colbert_config)
|
| 96 |
-
obj = super().from_pretrained(name_or_path, colbert_config=colbert_config)
|
| 97 |
obj.base = name_or_path
|
| 98 |
|
| 99 |
return obj
|
|
|
|
| 90 |
|
| 91 |
|
| 92 |
@classmethod
|
| 93 |
+
def from_pretrained(cls, name_or_path, config=None):
|
| 94 |
colbert_config = ColBERTConfig(name_or_path)
|
| 95 |
colbert_config = ColBERTConfig.from_existing(ColBERTConfig.load_from_checkpoint(name_or_path), colbert_config)
|
| 96 |
+
obj = super().from_pretrained(name_or_path, colbert_config=colbert_config, config=config)
|
| 97 |
obj.base = name_or_path
|
| 98 |
|
| 99 |
return obj
|