Instructions to use sanjeevnv/multimodal-pretraining with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sanjeevnv/multimodal-pretraining with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sanjeevnv/multimodal-pretraining", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Use </s> as pretraining EOD token
Browse filesSet tokenizer EOS/EOD metadata to </s> (id 2), restrict generation EOS to id 2, and append </s> in the pretraining chat template. config.json already used eos_token_id 2, so it is unchanged.
- generation_config.json +1 -4
- special_tokens_map.json +1 -1
- tokenizer_config.json +2 -2
generation_config.json
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": null,
|
| 4 |
-
"eos_token_id":
|
| 5 |
-
2,
|
| 6 |
-
11
|
| 7 |
-
],
|
| 8 |
"pad_token_id": 0,
|
| 9 |
"transformers_version": "4.55.4"
|
| 10 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": null,
|
| 4 |
+
"eos_token_id": 2,
|
|
|
|
|
|
|
|
|
|
| 5 |
"pad_token_id": 0,
|
| 6 |
"transformers_version": "4.55.4"
|
| 7 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"eos_token": {
|
| 3 |
-
"content": "<
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": false,
|
| 6 |
"rstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
"eos_token": {
|
| 3 |
+
"content": "</s>",
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": false,
|
| 6 |
"rstrip": false,
|
tokenizer_config.json
CHANGED
|
@@ -8005,7 +8005,7 @@
|
|
| 8005 |
}
|
| 8006 |
},
|
| 8007 |
"clean_up_tokenization_spaces": false,
|
| 8008 |
-
"eos_token": "<
|
| 8009 |
"extra_special_tokens": {},
|
| 8010 |
"model_input_names": [
|
| 8011 |
"input_ids",
|
|
@@ -8014,5 +8014,5 @@
|
|
| 8014 |
"model_max_length": 262144,
|
| 8015 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 8016 |
"unk_token": "<unk>",
|
| 8017 |
-
"chat_template": "{#- Pretraining chat template: question/answer format with generation markers.\n Energon chooses whether to apply SFT loss masking or train on all tokens. -#}\n{%- for message in messages %}\n{%- if message.role == \"system\" %}\n{{- message.content }}\n{%- elif message.role == \"user\" %}\n{{- \"\\nquestion: \" + message.content }}\n{%- elif message.role == \"assistant\" %}\n{{- \"\\nanswer: \" }}{% generation %}{{- message.content }}{% endgeneration %}\n{%- endif %}\n{%- endfor %}\n"
|
| 8018 |
}
|
|
|
|
| 8005 |
}
|
| 8006 |
},
|
| 8007 |
"clean_up_tokenization_spaces": false,
|
| 8008 |
+
"eos_token": "</s>",
|
| 8009 |
"extra_special_tokens": {},
|
| 8010 |
"model_input_names": [
|
| 8011 |
"input_ids",
|
|
|
|
| 8014 |
"model_max_length": 262144,
|
| 8015 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 8016 |
"unk_token": "<unk>",
|
| 8017 |
+
"chat_template": "{#- Pretraining chat template: question/answer format with generation markers.\n Energon chooses whether to apply SFT loss masking or train on all tokens. -#}\n{%- for message in messages %}\n{%- if message.role == \"system\" %}\n{{- message.content }}\n{%- elif message.role == \"user\" %}\n{{- \"\\nquestion: \" + message.content }}\n{%- elif message.role == \"assistant\" %}\n{{- \"\\nanswer: \" }}{% generation %}{{- message.content }}{{- \"</s>\" }}{% endgeneration %}\n{%- endif %}\n{%- endfor %}\n"
|
| 8018 |
}
|