Instructions to use microsoft/Magma-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Magma-8B with Transformers:
# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("microsoft/Magma-8B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
add apply_chat_template for processor
Browse files- processing_magma.py +3 -0
processing_magma.py
CHANGED
|
@@ -118,6 +118,9 @@ class MagmaProcessor(ProcessorMixin):
|
|
| 118 |
|
| 119 |
return BatchFeature(data={**text_inputs, **image_inputs})
|
| 120 |
|
|
|
|
|
|
|
|
|
|
| 121 |
# Copied from transformers.models.clip.processing_clip.CLIPProcessor.batch_decode with CLIP->Llama
|
| 122 |
def batch_decode(self, *args, **kwargs):
|
| 123 |
"""
|
|
|
|
| 118 |
|
| 119 |
return BatchFeature(data={**text_inputs, **image_inputs})
|
| 120 |
|
| 121 |
+
def apply_chat_template(self, *args, **kwargs):
|
| 122 |
+
return self.tokenizer.apply_chat_template(*args, **kwargs)
|
| 123 |
+
|
| 124 |
# Copied from transformers.models.clip.processing_clip.CLIPProcessor.batch_decode with CLIP->Llama
|
| 125 |
def batch_decode(self, *args, **kwargs):
|
| 126 |
"""
|