Instructions to use captioner/caption-gen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use captioner/caption-gen with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="captioner/caption-gen")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("captioner/caption-gen") model = AutoModelForMultimodalLM.from_pretrained("captioner/caption-gen") - Notebooks
- Google Colab
- Kaggle
Devin Zhang commited on
Commit ·
e52ccfb
1
Parent(s): 6091052
BLIP Tokenizer
Browse files- tokenizer.json +0 -0
- tokenizer_config.json +25 -0
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"do_basic_tokenize": true,
|
| 4 |
+
"do_lower_case": true,
|
| 5 |
+
"mask_token": "[MASK]",
|
| 6 |
+
"model_max_length": 512,
|
| 7 |
+
"name_or_path": "Salesforce/blip-image-captioning-large",
|
| 8 |
+
"never_split": null,
|
| 9 |
+
"pad_token": "[PAD]",
|
| 10 |
+
"model_input_names": [
|
| 11 |
+
"input_ids",
|
| 12 |
+
"attention_mask"
|
| 13 |
+
],
|
| 14 |
+
"processor_class": "BlipProcessor",
|
| 15 |
+
"sep_token": "[SEP]",
|
| 16 |
+
"special_tokens_map_file": null,
|
| 17 |
+
"strip_accents": null,
|
| 18 |
+
"tokenize_chinese_chars": true,
|
| 19 |
+
"tokenizer_class": "BertTokenizer",
|
| 20 |
+
"unk_token": "[UNK]",
|
| 21 |
+
"model_input_names": [
|
| 22 |
+
"input_ids",
|
| 23 |
+
"attention_mask"
|
| 24 |
+
]
|
| 25 |
+
}
|