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 -2
modeling_gpt2vision.py
CHANGED
|
@@ -60,9 +60,10 @@ class GPT2Vision(PreTrainedModel):
|
|
| 60 |
images = batch['image']
|
| 61 |
if isinstance(text, str):
|
| 62 |
text = [text]
|
| 63 |
-
|
|
|
|
| 64 |
text_inputs = self.tokenizer(
|
| 65 |
-
|
| 66 |
padding='max_length',
|
| 67 |
truncation=True,
|
| 68 |
max_length=768,
|
|
|
|
| 60 |
images = batch['image']
|
| 61 |
if isinstance(text, str):
|
| 62 |
text = [text]
|
| 63 |
+
|
| 64 |
+
print("text",text)
|
| 65 |
text_inputs = self.tokenizer(
|
| 66 |
+
text,
|
| 67 |
padding='max_length',
|
| 68 |
truncation=True,
|
| 69 |
max_length=768,
|