Loading in 8-bit
Browse files- handler.py +2 -2
handler.py
CHANGED
@@ -22,8 +22,8 @@ class EndpointHandler():
|
|
22 |
|
23 |
self.model = Blip2ForConditionalGeneration.from_pretrained(
|
24 |
"Salesforce/blip2-flan-t5-xxl", device_map=device_map,
|
25 |
-
torch_dtype=torch.float16
|
26 |
-
|
27 |
)
|
28 |
|
29 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
22 |
|
23 |
self.model = Blip2ForConditionalGeneration.from_pretrained(
|
24 |
"Salesforce/blip2-flan-t5-xxl", device_map=device_map,
|
25 |
+
# torch_dtype=torch.float16
|
26 |
+
load_in_8bit=True,
|
27 |
)
|
28 |
|
29 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
|