Upload handler.py
Browse filesadded the model name Salesforce/blip2-opt-6.7b to the handler.
this will handler the multimodal task to generate the image description
- handler.py +2 -2
handler.py
CHANGED
@@ -8,8 +8,8 @@ from io import BytesIO
|
|
8 |
|
9 |
class EndpointHandler():
|
10 |
def __init__(self, path=""):
|
11 |
-
self.processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-
|
12 |
-
self.model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-opt-
|
13 |
|
14 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
self.model.to(self.device)
|
|
|
8 |
|
9 |
class EndpointHandler():
|
10 |
def __init__(self, path=""):
|
11 |
+
self.processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-6.7b")
|
12 |
+
self.model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-opt-6.7b")
|
13 |
|
14 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
self.model.to(self.device)
|