Instructions to use RISys-Lab/ReasonCLIP-L14-336-S2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RISys-Lab/ReasonCLIP-L14-336-S2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="RISys-Lab/ReasonCLIP-L14-336-S2") pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# Load model directly from transformers import AutoProcessor, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("RISys-Lab/ReasonCLIP-L14-336-S2") model = AutoModelForZeroShotImageClassification.from_pretrained("RISys-Lab/ReasonCLIP-L14-336-S2") - Notebooks
- Google Colab
- Kaggle
Upload processor
Browse files- processor_config.json +31 -0
- tokenizer_config.json +14 -32
processor_config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"crop_size": {
|
| 4 |
+
"height": 336,
|
| 5 |
+
"width": 336
|
| 6 |
+
},
|
| 7 |
+
"data_format": "channels_first",
|
| 8 |
+
"do_center_crop": true,
|
| 9 |
+
"do_convert_rgb": true,
|
| 10 |
+
"do_normalize": true,
|
| 11 |
+
"do_rescale": true,
|
| 12 |
+
"do_resize": true,
|
| 13 |
+
"image_mean": [
|
| 14 |
+
0.48145466,
|
| 15 |
+
0.4578275,
|
| 16 |
+
0.40821073
|
| 17 |
+
],
|
| 18 |
+
"image_processor_type": "CLIPImageProcessorFast",
|
| 19 |
+
"image_std": [
|
| 20 |
+
0.26862954,
|
| 21 |
+
0.26130258,
|
| 22 |
+
0.27577711
|
| 23 |
+
],
|
| 24 |
+
"resample": 3,
|
| 25 |
+
"rescale_factor": 0.00392156862745098,
|
| 26 |
+
"size": {
|
| 27 |
+
"shortest_edge": 336
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"processor_class": "CLIPProcessor"
|
| 31 |
+
}
|
tokenizer_config.json
CHANGED
|
@@ -1,32 +1,14 @@
|
|
| 1 |
-
{
|
| 2 |
-
"add_prefix_space": false,
|
| 3 |
-
"
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
"normalized": false,
|
| 16 |
-
"rstrip": false,
|
| 17 |
-
"single_word": false,
|
| 18 |
-
"special": true
|
| 19 |
-
}
|
| 20 |
-
},
|
| 21 |
-
"bos_token": "<|startoftext|>",
|
| 22 |
-
"clean_up_tokenization_spaces": false,
|
| 23 |
-
"do_lower_case": true,
|
| 24 |
-
"eos_token": "<|endoftext|>",
|
| 25 |
-
"errors": "replace",
|
| 26 |
-
"extra_special_tokens": {},
|
| 27 |
-
"model_max_length": 77,
|
| 28 |
-
"pad_token": "<|endoftext|>",
|
| 29 |
-
"processor_class": "CLIPProcessor",
|
| 30 |
-
"tokenizer_class": "CLIPTokenizer",
|
| 31 |
-
"unk_token": "<|endoftext|>"
|
| 32 |
-
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|startoftext|>",
|
| 5 |
+
"do_lower_case": true,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"model_max_length": 77,
|
| 10 |
+
"pad_token": "<|endoftext|>",
|
| 11 |
+
"processor_class": "CLIPProcessor",
|
| 12 |
+
"tokenizer_class": "CLIPTokenizer",
|
| 13 |
+
"unk_token": "<|endoftext|>"
|
| 14 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|