Commit
·
19d6e36
1
Parent(s):
54ddd45
trying to use blip2-flant5xxl
Browse files
app.py
CHANGED
|
@@ -14,14 +14,14 @@ model = Blip2ForConditionalGeneration.from_pretrained(
|
|
| 14 |
"Salesforce/blip2-flan-t5-xxl", load_in_8bit=True, device_map='auto'
|
| 15 |
)
|
| 16 |
|
| 17 |
-
# Uncomment lines 20, 22, 23 to begin using blip2-oopt-2.7b model
|
| 18 |
|
| 19 |
# Load the BLIP-2 model and processor
|
| 20 |
#processor = AutoProcessor.from_pretrained("Salesforce/blip2-opt-2.7b")
|
| 21 |
# Load model in int8 using bitsandbytes, and pass device_map='auto'
|
| 22 |
#model = Blip2ForConditionalGeneration.from_pretrained(
|
| 23 |
# "Salesforce/blip2-opt-2.7b", load_in_8bit=True, device_map='auto'
|
| 24 |
-
)
|
| 25 |
|
| 26 |
def blip2_interface(image, prompted_caption_text, vqa_question, chat_context):
|
| 27 |
# Prepare image input
|
|
|
|
| 14 |
"Salesforce/blip2-flan-t5-xxl", load_in_8bit=True, device_map='auto'
|
| 15 |
)
|
| 16 |
|
| 17 |
+
# Uncomment lines 20, 22, 23, & 24 to begin using blip2-oopt-2.7b model
|
| 18 |
|
| 19 |
# Load the BLIP-2 model and processor
|
| 20 |
#processor = AutoProcessor.from_pretrained("Salesforce/blip2-opt-2.7b")
|
| 21 |
# Load model in int8 using bitsandbytes, and pass device_map='auto'
|
| 22 |
#model = Blip2ForConditionalGeneration.from_pretrained(
|
| 23 |
# "Salesforce/blip2-opt-2.7b", load_in_8bit=True, device_map='auto'
|
| 24 |
+
#)
|
| 25 |
|
| 26 |
def blip2_interface(image, prompted_caption_text, vqa_question, chat_context):
|
| 27 |
# Prepare image input
|