Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -7,7 +7,7 @@ class EndpointHandler:
|
|
7 |
def __init__(self, path=""):
|
8 |
# load model and processor from path
|
9 |
self.processor = AutoProcessor.from_pretrained(path)
|
10 |
-
self.model = Blip2ForConditionalGeneration.from_pretrained(path,
|
11 |
|
12 |
def __call__(self, inputs: Dict[str, Any]) -> Dict[str, str]:
|
13 |
"""
|
|
|
7 |
def __init__(self, path=""):
|
8 |
# load model and processor from path
|
9 |
self.processor = AutoProcessor.from_pretrained(path)
|
10 |
+
self.model = Blip2ForConditionalGeneration.from_pretrained(path, device_map="auto", load_in_8bit=True).to("cuda")
|
11 |
|
12 |
def __call__(self, inputs: Dict[str, Any]) -> Dict[str, str]:
|
13 |
"""
|