Update usage.py
Browse files
usage.py
CHANGED
|
@@ -4,8 +4,7 @@ from transformers import BlipProcessor, BlipForConditionalGeneration
|
|
| 4 |
|
| 5 |
# Load the BLIP model and processor
|
| 6 |
processor = BlipProcessor.from_pretrained("image2text")
|
| 7 |
-
model = BlipForConditionalGeneration.from_pretrained('image2text')
|
| 8 |
-
|
| 9 |
# Load the image you want to describe
|
| 10 |
image_path = sys.argv[1]
|
| 11 |
raw_image = Image.open(image_path).convert('RGB')
|
|
|
|
| 4 |
|
| 5 |
# Load the BLIP model and processor
|
| 6 |
processor = BlipProcessor.from_pretrained("image2text")
|
| 7 |
+
model = BlipForConditionalGeneration.from_pretrained('image2text' , use_safetensors=True)
|
|
|
|
| 8 |
# Load the image you want to describe
|
| 9 |
image_path = sys.argv[1]
|
| 10 |
raw_image = Image.open(image_path).convert('RGB')
|