Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -5,7 +5,7 @@ import torch
|
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# load model and processor from path
|
8 |
-
self.model =
|
9 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
10 |
|
11 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
|
|
5 |
class EndpointHandler:
|
6 |
def __init__(self, path=""):
|
7 |
# load model and processor from path
|
8 |
+
self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", load_in_8bit=True)
|
9 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
10 |
|
11 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|