Printing device map
Browse files- handler.py +3 -0
handler.py
CHANGED
@@ -20,6 +20,9 @@ class EndpointHandler():
|
|
20 |
device_map = infer_auto_device_map(model, no_split_module_classes=["T5Block"])
|
21 |
device_map['language_model.lm_head'] = device_map["language_model.encoder.embed_tokens"]
|
22 |
|
|
|
|
|
|
|
23 |
self.model = Blip2ForConditionalGeneration.from_pretrained(
|
24 |
"Salesforce/blip2-flan-t5-xxl", device_map=device_map,
|
25 |
# torch_dtype=torch.float16
|
|
|
20 |
device_map = infer_auto_device_map(model, no_split_module_classes=["T5Block"])
|
21 |
device_map['language_model.lm_head'] = device_map["language_model.encoder.embed_tokens"]
|
22 |
|
23 |
+
print(device_map)
|
24 |
+
exit()
|
25 |
+
|
26 |
self.model = Blip2ForConditionalGeneration.from_pretrained(
|
27 |
"Salesforce/blip2-flan-t5-xxl", device_map=device_map,
|
28 |
# torch_dtype=torch.float16
|