Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -12,7 +12,7 @@ class EndpointHandler():
|
|
12 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
|
14 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
15 |
-
self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", trust_remote_code=True)
|
16 |
|
17 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
18 |
|
|
|
12 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
|
14 |
self.tokenizer = AutoTokenizer.from_pretrained(path)
|
15 |
+
self.model = AutoModelForCausalLM.from_pretrained(path, device_map="auto", offload_folder='offload', trust_remote_code=True)
|
16 |
|
17 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
18 |
|