Instructions to use damerajee/GPT-Vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use damerajee/GPT-Vision with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import GPTVision model = GPTVision.from_pretrained("damerajee/GPT-Vision", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_gpt2vision.py
Browse files- modeling_gpt2vision.py +3 -3
modeling_gpt2vision.py
CHANGED
|
@@ -74,9 +74,9 @@ class GPT2Vision(PreTrainedModel):
|
|
| 74 |
}
|
| 75 |
|
| 76 |
def preprocess_inputs(self, batch):
|
| 77 |
-
pixel_values = batch['pixel_values']
|
| 78 |
-
input_ids = batch['input_ids']
|
| 79 |
-
attention_mask = batch['attention_mask']
|
| 80 |
input_ids = input_ids.to(self.device)
|
| 81 |
attention_mask = attention_mask.to(self.device)
|
| 82 |
pixel_values = pixel_values.to(self.device)
|
|
|
|
| 74 |
}
|
| 75 |
|
| 76 |
def preprocess_inputs(self, batch):
|
| 77 |
+
pixel_values = batch['pixel_values']
|
| 78 |
+
input_ids = batch['input_ids']
|
| 79 |
+
attention_mask = batch['attention_mask']
|
| 80 |
input_ids = input_ids.to(self.device)
|
| 81 |
attention_mask = attention_mask.to(self.device)
|
| 82 |
pixel_values = pixel_values.to(self.device)
|