Feature Extraction
Transformers
Safetensors
condvit
lrvsf-benchmark
custom_code
Eval Results (legacy)
Instructions to use Slep/CondViT-B16-cat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Slep/CondViT-B16-cat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Slep/CondViT-B16-cat", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Slep/CondViT-B16-cat", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload CondViTForEmbedding
Browse files- config.json +1 -1
- hf_model.py +2 -2
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"CondViTForEmbedding"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "__debug_save",
|
| 3 |
"architectures": [
|
| 4 |
"CondViTForEmbedding"
|
| 5 |
],
|
hf_model.py
CHANGED
|
@@ -43,5 +43,5 @@ class CondViTForEmbedding(PreTrainedModel):
|
|
| 43 |
n_categories=config.n_categories,
|
| 44 |
)
|
| 45 |
|
| 46 |
-
def forward(self,
|
| 47 |
-
return self.model(
|
|
|
|
| 43 |
n_categories=config.n_categories,
|
| 44 |
)
|
| 45 |
|
| 46 |
+
def forward(self, pixel_values, category_indices=None):
|
| 47 |
+
return self.model(imgs=pixel_values, c=category_indices)
|