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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("captioner/caption-gen") model = AutoModelForImageTextToText.from_pretrained("captioner/caption-gen") - Notebooks
- Google Colab
- Kaggle
Devin Zhang commited on
Commit ·
0efb82e
1
Parent(s): 4509d14
Upload 2 files
Browse files- tokenizer.json +0 -0
- tokenizer_config.json +19 -0
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"do_lower_case": true,
|
| 4 |
+
"mask_token": "[MASK]",
|
| 5 |
+
"model_input_names": [
|
| 6 |
+
"input_ids",
|
| 7 |
+
"attention_mask"
|
| 8 |
+
],
|
| 9 |
+
"model_max_length": 512,
|
| 10 |
+
"name_or_path": "bert-base-uncased",
|
| 11 |
+
"pad_token": "[PAD]",
|
| 12 |
+
"processor_class": "GitProcessor",
|
| 13 |
+
"sep_token": "[SEP]",
|
| 14 |
+
"special_tokens_map_file": null,
|
| 15 |
+
"strip_accents": null,
|
| 16 |
+
"tokenize_chinese_chars": true,
|
| 17 |
+
"tokenizer_class": "BertTokenizer",
|
| 18 |
+
"unk_token": "[UNK]"
|
| 19 |
+
}
|