Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ if not os.path.exists('IndicTransToolkit'):
|
|
17 |
from IndicTransToolkit import IndicProcessor
|
18 |
|
19 |
# Initialize BLIP for image captioning
|
20 |
-
blip_processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-
|
21 |
-
blip_model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-
|
22 |
|
23 |
# Function to generate captions
|
24 |
def generate_caption(image_path):
|
|
|
17 |
from IndicTransToolkit import IndicProcessor
|
18 |
|
19 |
# Initialize BLIP for image captioning
|
20 |
+
blip_processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
|
21 |
+
blip_model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large").to("cuda" if torch.cuda.is_available() else "cpu")
|
22 |
|
23 |
# Function to generate captions
|
24 |
def generate_caption(image_path):
|